Home > Net >  Windows 7 MouseWheel bound to the controls, not triggering event?
Windows 7 MouseWheel bound to the controls, not triggering event?

Time:09-23

This. PictureBox1. MouseWheel +=new System. Windows. Forms. MouseEventHandler (enclosing PictureBox1_MouseWheel);

Void PictureBox1_MouseWheel (object sender, MouseEventArgs e)
{
If (e.D elta & gt; 0)
{
This. The Text="is scroll up pulley";
}
The else
{
This. The Text="is scroll down the pulley";
}
}

Win10 can trigger the event, and Windows 7 can't, what reason be cause?

CodePudding user response:

https://www.cnblogs.com/susuzhao/articles/3522610.html
This mouse rolling pro measurement is available, you said, because must get focus seems to trigger,

CodePudding user response:

Mean, I need to set focus on a form always on PictureBox1, can enter PictureBox1_MouseWheel method?

CodePudding user response:

You can try, I tried the operation is very abnormal, is not very friendly, you of the above methods I put a picture into a panel to panel add a hover event gains focus, then sometimes success or not success

CodePudding user response:

This should be and the system it doesn't matter

CodePudding user response:

My current measures are enclosing MouseWheel +=new System. Windows. Forms. MouseEventHandler (enclosing PictureBox1_MouseWheel);
Binding on the form of the MouseWheel directly, and then by means of the mouse position e.X and e.Y access controls,
  •  Tags:  
  • C#
  • Related