Silverlight C# - Is it possible to add a contextual pop-down list to a textbox? (Example image attached)
I'm adding a spellcheck to my application, and have added the Vectorlight Spell Check Component to my project. When the spellcheck button is clicked I'd like to have the project make it have a pop-down wherever a spelling error occurs, and then have a pop-down list of suggestions similar to the contextual suggestions that Visual Studio gives you.
Example:
Is this doable in Silverlight 4.0 with C#? If so, what is the control called?
If not possible, then perhaps have t开发者_运维知识库he word get the squiggly red underline and when you right-click it then that menu has the suggestions? I've no idea how to populate the right-click menu in Silverlight either. (I would imagine I'll have to change to a RichTextBox in order to have the underline bit work - correct me if I'm wrong)
Thanks in advance for your help!
-Sootah
If you don't want it to open on right-click (as skypecakes' answer would with ContextMenu) you should just be able to use Popup. You can position that appopriately, then have its contents be a ListBox (or ItemsControl) which has an ItemTemplate containing an Image and a TextBlock, or whatever else you like.
This is how ComboBox shows its drop-down menu.
To create a context menu, use ContextMenuService.ContextMenu.
Here is a link with sample code: New context menu functionality in Silverlight 4
精彩评论