c# - disable mouse wheel on itemscontrol in wpf -


I have a user control in which there is a scrollover, then one of the hair controls like hair boxes, radio buttons, and listboxes etc. The bunch is. In it I can use the mouse wheel until my mouse is able to scroll to the ground inside a listback, then the mouse wheel moves to the event list. Is there a way to send the list back to the parent control on those events? Like this question, removal list box from parent control gets suggested () is not a solution.

I have tried

  Zero ListBox_PreviewMouseWheel (Object Sender, MouseWheelEventArgs e) {e. Handle = true; }  

But that also does not work

Thank you

The answer you have given is the same as your problem The reason is that the listbox in your scroll weaver (which is composed of a scrollwizard between the other things) has grabbed the mousewheel event and took it, preventing it from bubbling and thus showing the scroll weaver

To do this, use the following extremely simple control templates for your list box. Do not pay attention (it is not Scrolwuyr it and therefore scroll with the mouse on the mouse Whiel event will not be caught) ScrollViewer still list box.

  & lt; UserControl.Resources & gt; & Lt; ControlTemplate x: key = "noscroll" & gt; & Lt; ItemsPresenter & gt; & Lt; / ItemsPresenter & gt; & Lt; / ControlTemplate & gt; & Lt; /UserControl.Resources> & Lt; ScrollViewer & gt; & Lt; SomeContainerControl & gt; & Lt; .... which are the other controls in your scrollwhether & gt; & Lt; Listbox templates = "{static resource nosols}" & gt; & Lt; / ListBox & gt; & Lt; SomeContainerControl & gt; & Lt; / ScrollViewer & gt;  

You have the option of capturing a mouse when it enters the scroll weaver, though it continues to receive all mouse events until the mouse is released, although this option You will need to confuse somebody else if you want a response, then mouse events on the controls contained within the ScrollViewer ... The following mouse-on mouse mouse event handlers will be sufficient.

  Private Zero ScrollViewerMouseEnter (Object Sender, MouseEventArgs E) {(ScrollViewer) Sender). CaptureMouse (); } Private Zero ScrollViewerMouseLeave (Object Sender, MouseEventArgs E) {((ScrollViewer) Sender). ReleaseMouseCapture (); }  

None of the work I have given is actually not liked, and I can suggest to think again what you are trying to do exactly . If you explain what you are trying to achieve in your question then I am sure you will get some more suggestions ...


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -