I hope this helps you . How can I produce a messagebox in a C# Win Forms application that displays a combobox with a series of values to select as well as the usual "Ok" button? , Use a custom Form instead with .ShowDialog()
MessageBox pops up behind ComboBox drop down list, obscuring content in MessageBox
will help you Well I can't reprodouce your issue, but I believe that using the Dispatcher can help. Try this:
Private Sub ComboBox_SelectionChanged(sender As System.Object, e As System.Windows.Controls.SelectionChangedEventArgs)
'Do what you need..
MessageBox.Show("Message", "Caption", MessageBoxButton.OK, MessageBoxImage.Information)
fixed the issue. Will look into that further Use a custom Form instead with .ShowDialog() method. You may have to somehow override the DialogResult Enumeration though I'd think just passing back whatever you need may be simpler. Update: If the combobox provides integer values, you could do something like this if you set DialogResult to that integer in your custom form. FYI ShowMsg is my overloaded function that will display my custom form based on the arguments sent.
Dim Result As DialogResult = _
ShowMsg("Select from the combobox", "Select an integer", ShowMsgButtons.OK, ShowMsgImage.Exclmation, ShowMsgDefaultButton.Button1)
Select Case Result
'what happens when they select 10 from the combobox
'what happens when they select 20 from the combobox
'what happens when they select 30 from the combobox
How can I print the text immediately in combobox with bind event?
I wish this helpful for you You have it very close. The bind statement is slightly different from what you need. The problem was that it was printing before the key was delivered to the combobox. Now it waits until the key is released to fire the event.