The line "e.SuppressKeyPress" doesn't work when I execute a "Form2.ShowDialog()" line in the KeyDown event subr.
The exact same "e.SuppressKeyPress" line DOES work if I execute a "Form2.Show()" line in the same KeyDown event subr.
Seems to me it SHOULD work in both cases.
P.S. I STILL don't get email notifications of replies to my posts...
Wolven said:Do you mean the Microsoft ComboBox acts exactly the same way? Is this another case of duplicating a MS bug?
I don't think I would call this a bug. It's simply the built-in Windows behavior. Showing a modal dialog in the MouseDown is going to cause the focus to be lost on and thus the control never gets a MouseUp. My advice would be to avoid showing modal dialogs in the MouseDown as a general rule, regardless of which control you are using.
Wolven said:The BeginInvoke method isn't going to work because it allows the calling program to continue processing after queing the Invoke. The whole point of ShowDialog is to stop the calling program until the dialog form is closed.
Have you tested this out? I don't think that's how it works. Yes, the execution of the program will continue after you call BeginInvoke, but that's the whole point. That way, the control will get the MouseUp message before the dialog is displayed. Once the dialog is displayed, execution will be halted.
Do you mean the Microsoft ComboBox acts exactly the same way? Is this another case of duplicating a MS bug?
The BeginInvoke method isn't going to work because it allows the calling program to continue processing after queing the Invoke. The whole point of ShowDialog is to stop the calling program until the dialog form is closed.
This does not appear to have anything specifically to do with the UltraComboEditor. I replaced the UltraComboEditor controls in this sample with ComboBox controls and I get exactly the same results.
It's always a bit tricky to show a MessageBox or a dialog inside the KeyDown event. Showing a dialog c***the control to lose focus, and changing the focus in the KeyDown event can cause all sorts of unexpected behavior since it interferes with the firing of events.
Maybe you can get around this using a BeginInvoke to show the dialog, rather than showing it directly within the event.
OK Mike, Here's the sample project.
Hi,
I can't see why the show or showdialog should have any effect on this. Can you post a small sample project demonstrating this?