Click here to Skip to main content
15,903,362 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: hide all the controls in a column Pin
Wayne Gaylard9-Nov-11 19:15
professionalWayne Gaylard9-Nov-11 19:15 
GeneralRe: hide all the controls in a column Pin
saurabh001 m9-Nov-11 19:26
saurabh001 m9-Nov-11 19:26 
GeneralRe: hide all the controls in a column Pin
Wayne Gaylard9-Nov-11 19:30
professionalWayne Gaylard9-Nov-11 19:30 
GeneralRe: hide all the controls in a column Pin
saurabh001 m9-Nov-11 19:41
saurabh001 m9-Nov-11 19:41 
GeneralRe: hide all the controls in a column Pin
Wayne Gaylard9-Nov-11 20:03
professionalWayne Gaylard9-Nov-11 20:03 
GeneralRe: hide all the controls in a column Pin
SledgeHammer0110-Nov-11 6:27
SledgeHammer0110-Nov-11 6:27 
Question1 Storyboard and Multi Button Action Pin
delibey9-Nov-11 14:17
delibey9-Nov-11 14:17 
QuestionDynamically adding event handlers Pin
Dominick Marciano9-Nov-11 12:59
professionalDominick Marciano9-Nov-11 12:59 
For my application I need to have different context menus for different text boxes. One of the features I wanted to add to the context menu was the ability to add words to a custom dictionary as the application will be used in a technical field where a lot of words won't be in a standard dictionary. I found a snippet of code online that showed how to do this, however it is in C# and uses a lambda expression that I'm having a very hard time converting. The specific line of code I'm having trouble with is this:

C#
mnuAddToDictionary.Click += (object o, RoutedEventArgs rea) =>
                {
this.AddToDictionary(this.txtEdit.SelectedText);
                };


mnuAddToDictionary is a menu item and AddToDictionary is the method that actually does work of adding the selected misspelled word to the custom dictionary.

The AddToDictionary method is set up thus:

VB
Public Sub AddToDictionary(ByVal entry as string)

End Sub


The closest I was able to get was AddHandler AddToDictionary.Click, AddressOf AddToDictionary, however I'm getting an error message because the delegate and the method do not have the same signature.

I pretty new to WPF and I'm not familiar with lambda expression yet because I never needed them. Any help would be greatly appreciated as I'm at a loss of what to do now. Any help would be greatly appreciated and thanks in advance.
AnswerRe: Dynamically adding event handlers Pin
SledgeHammer019-Nov-11 13:19
SledgeHammer019-Nov-11 13:19 
GeneralRe: Dynamically adding event handlers Pin
Dominick Marciano9-Nov-11 13:30
professionalDominick Marciano9-Nov-11 13:30 
GeneralRe: Dynamically adding event handlers Pin
Dominick Marciano9-Nov-11 13:35
professionalDominick Marciano9-Nov-11 13:35 
AnswerRe: Dynamically adding event handlers Pin
Dominick Marciano9-Nov-11 13:46
professionalDominick Marciano9-Nov-11 13:46 
QuestionHorizontalContentAlignment=Left and still stretch the contentcontrol Pin
indian1439-Nov-11 10:36
indian1439-Nov-11 10:36 
QuestionContentControl Pin
indian1438-Nov-11 13:25
indian1438-Nov-11 13:25 
AnswerRe: ContentControl Pin
Abhinav S8-Nov-11 21:33
Abhinav S8-Nov-11 21:33 
GeneralRe: ContentControl Pin
indian1439-Nov-11 7:16
indian1439-Nov-11 7:16 
AnswerRe: ContentControl Pin
Mark Salsbery9-Nov-11 5:44
Mark Salsbery9-Nov-11 5:44 
GeneralRe: ContentControl Pin
indian1439-Nov-11 7:08
indian1439-Nov-11 7:08 
QuestionMVVM Recommendations Pin
Tom Delany8-Nov-11 7:10
Tom Delany8-Nov-11 7:10 
AnswerRe: MVVM Recommendations Pin
SledgeHammer018-Nov-11 7:23
SledgeHammer018-Nov-11 7:23 
GeneralRe: MVVM Recommendations Pin
Tom Delany8-Nov-11 7:52
Tom Delany8-Nov-11 7:52 
AnswerRe: MVVM Recommendations Pin
Kevin Marois8-Nov-11 7:36
professionalKevin Marois8-Nov-11 7:36 
GeneralRe: MVVM Recommendations Pin
Tom Delany8-Nov-11 7:53
Tom Delany8-Nov-11 7:53 
AnswerRe: MVVM Recommendations Pin
Abhinav S8-Nov-11 21:38
Abhinav S8-Nov-11 21:38 
GeneralRe: MVVM Recommendations Pin
Tom Delany9-Nov-11 3:57
Tom Delany9-Nov-11 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.