We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How can I handle the Wheel Mouse control in TreeViewAdv control (windows Froms)

Thread ID:

Created:

Updated:

Platform:

Replies:

119283 Jun 1,2015 12:01 PM Jun 3,2015 03:07 AM Windows Forms 1
loading
Tags: TreeViewAdv
Yosvany Noda
Asked On June 1, 2015 12:01 PM

Hello,

We are using Syncfusion TreeViewAdv control (windows form) to create an add in to excel. When focus is on a vertical scrolling control inside the Excel task pane and the user moves the mouse scroll wheel both take the scroll (the control and the associated worksheet) How we can handle the wheel event this issue only happen in Syncfusion control not in the Microsoft TreeView.

thank you

Saravanan T [Syncfusion]
Replied On June 3, 2015 03:07 AM

Hi Yosvany,

Sorry for the inconvenience caused,

In this reported scenario, TreeViewAdv captures the MouseWheel input of its Parent container and hence TreeViewAdv scrolling functionality is also invoked. This reported requirement can be achieved by creating custom control which is inherited from TreeViewAdv and overriding its function “OnMouseWheel”. Please make use of below code snippet.

Code Snippet: [C#]

protected override void OnMouseWheel(System.Windows.Forms.MouseEventArgs e)

{

    HandledMouseEventArgs handledEventArgs = e as HandledMouseEventArgs;

    if (handledEventArgs == null || !handledEventArgs.Handled)

    {

        if (((Control.ModifierKeys & (Keys.Alt | Keys.Shift)) == Keys.None) && (Control.MouseButtons == MouseButtons.None))

        {

            if (handledEventArgs != null)

            {

                handledEventArgs.Handled = true;

            }

        }

    }

    base.OnMouseWheel(e);
}


We have also prepared a sample, MSDN Link and reordered a video for your reference and it can be downloaded from the following location.

Sample Location: http://www.syncfusion.com/downloads/support/forum/119283/ze/TreeViewAdv_ExcelAddin-135493008

Video Location: http://www.syncfusion.com/downloads/support/forum/119283/ze/TreeView_TestingVideo-519683845

MSDN Link : https://msdn.microsoft.com/en-us/library/system.windows.forms.handledmouseeventargs(v=vs.110).aspx

We have considered this requirement as bug and this fix will be included in our main release Volume 2, 2015, which will be released in June 2015. Could you please check with the above sample and video and let us know if it helps? Otherwise please share us more details about the reported scenario. That will be helpful for us to analyze and provide you a prompt solution as earlier as possible.

Please let us know if you need any further assistance on this,

Regards,
Saravanan T

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;