I want to disable mouse wheel in UltraComboEditor. In other words, I don't want user to select the item by mouse wheel, they can just select item from drop down list. I've tried many ways and all failed. But MS comboBox can handle everything as I want.
Then I made an experiment between MS comboBox and UltraComboEditor. I find that UltraComboEditor can not handle mouse wheel event while MS comboBox can. I tried 3 ways to debug whether this control can capture mouse wheel event. Blow is the 3 ways of my experiment. I set several breakponts to ensure combobox can handle mouse wheel event. MS combo can enter all the breakponts but UltraCombo can't. Anyone can help me?
const int WM_MOUSEWHEEL = 0x020A;
protected override void WndProc(ref Message m) { //stop scroll if (m.Msg == WM_MOUSEWHEEL) { //but force next item int delta; if ((int)m.WParam > 0) { //up delta = 1; } else { //down delta = -1; } this.OnMouseWheel(new MouseEventArgs(MouseButtons.None, 0, 0, 0, delta));
return; }
base.WndProc(ref m); }
protected override void OnMouseWheel(MouseEventArgs e) { base.OnMouseWheel(e); }
public Form1() { this.testUltraCmb1.MouseWheel += new MouseEventHandler(testUltraCmb1_MouseWheel); }
public void testUltraCmb1_MouseWheel(object sender, MouseEventArgs e) { HandledMouseEventArgs handledArgs = e as HandledMouseEventArgs; if (handledArgs != null) handledArgs.Handled = true; }
I know this post is ancient but I had a similar problem. In my application, once a selection was made from the Combo. The screen would change quite a bit and the intuitive thing for the user to do was roll the mouse wheel so they could more closely examine a Web Browser control containg color coded SQL. Thing is that would scroll the combo because we human users would consistently fotrget to click the Web Browser contrrol ... first. I tried to get the focus to change to another control but I was unable to get that to happen. That is fine, I personally never trust the Focus method anyways.
So a quick Google pointed me to this link, also on the Infragistics sight :
http://ko.infragistics.com/community/blogs/andrew_flick/archive/2009/06/22/disabling-wheel-scrolling-in-the-ultracombo.aspx
It works a treat.
Another discussion brought me to a solution, which made me happy:
http://community.infragistics.com/forums/p/43840/240659.aspx#240659
Thank you anyway, Bye
Hello community!
Thanks to this discussion I could solve part of my problem allready. But I'm stuck with another one:
I'm using an UltraComboEditor-derived control to display my own Tree-Structure within a DropDownButton. Everything works very fine.
As this control is used as a normal dialog control as well as in grid cells as their EditorControl, I found out, that all the needed events (Key-Events, DropDown-Events, ...) must be handled with the control itselfe as well as with the ExternalEditor.
The last issue to solve ist the MouseWheel. With this discussion I found out how to disable mouse wheeling in den dialog combos. But as an EditorControl the MouseWheel insists to work within a grid cell. Regrettfully there is no ControlAdded-Event with the combos ExternalEditor. Also the Grid's MouseWheel-Event will not fire.
Do you have any suggestions?
TIA
Mike,
I used the MessageBox on purpose to force the form to lose focus to show that the ComboBox has already scrolled.
But you are absolutely right. My test project was using the old version of the dll's (8.2.20082.1000). So I changed the dll's manually to 8.2.20082.2194 and now the scroll works correctly. So this issue is resolved.
Thanks a lot!
Hi,
Okay, I ran your sample and moved the mouse over the combo and spun my mouse wheel. I get a message box indicating that the event is firing correctly.
I took the message box out, because it's not a good idea to use message boxes for debugging. Forcing the form to lose focus to another window can often cause adverse affects to what you are trying to test.
Either way, with or without the message box, the combo does not scroll or change it's value in response to the mouse wheel on my machine. If this is not working for you, then my only guess is that you either don't have the latest service release installed or the project is not actually using it. Your project here is using v8.2. Perhaps you installed the service release for some other version?