Mousewheel event not firing

前端 未结 1 794
执念已碎
执念已碎 2020-12-10 11:24

I\'ve looked at this thread concerning the exact same problem but that solution didn\'t work for me.
Basically what I am trying to accomplish is a mouse wheel event whe

相关标签:
1条回答
  • 2020-12-10 12:13

    The chartcontrol needs to be focused on so the mousewheel event can fire. You can set the focus when the mouse enter in the control, and give the focus to its parent back when it leaves it.

    void friendChart_MouseLeave(object sender, EventArgs e)
    {
        if (friendChart.Focused)
            friendChart.Parent.Focus();
    }
    
    void friendChart_MouseEnter(object sender, EventArgs e)
    {
        if (!friendChart.Focused)
            friendChart.Focus();
    }
    
    0 讨论(0)
提交回复
热议问题