Home > Net >  Wheel events MouseWheel different performance in different operating systems, where is the problem?
Wheel events MouseWheel different performance in different operating systems, where is the problem?

Time:09-16

Drawing on a Panel, I use the roller to control zooming, run on most computers have no problem, but on a small number of Windows 7 and Windows2012 capture wheel events, yesterday and found a computer and the question, Windows2012 new suit system, write the test code is as follows:
 public partial class Form1: Form 
{
Int tick=0;
Public _click ()
{
InitializeComponent();

This. Panel1. MouseWheel +=new MouseEventHandler (Control_MouseWheel);
This. Panel1. MouseDown +=new MouseEventHandler (Control_MouseDown);

This. The listBox1. The MouseWheel +=new MouseEventHandler (Control_MouseWheel);
This. The listBox1. MouseDown +=new MouseEventHandler (Control_MouseDown);

This. PictureBox1. MouseWheel +=new MouseEventHandler (Control_MouseWheel);
This. PictureBox1. MouseDown +=new MouseEventHandler (Control_MouseDown);
}

Void Control_MouseDown (object sender, MouseEventArgs e)
{
Tick++;
This Text=((System. Windows. Forms. Control) sender). The Name + tick. The ToString ();
}
Void Control_MouseWheel (object sender, MouseEventArgs e)
{
If (e.D elta & gt; 0)
{
Tick++;
}
Else if (e.D elta & lt; 0)
{
Tick -;
}
The else
{
Tick=0;
}
This Text=((System. Windows. Forms. Control) sender). The Name + tick. The ToString ();
}


}


Under normal circumstances, listBox1, panel1 pictureBox1 can capture the MouseWheel event, but the target computer only listBox1 events all the time, even if the mouse over the Panel also remains a listBox wheel events, I know this is because the Panel and PictureBox is no focal point control, but the problem is more than 90% of the computer they can capture the roller normal event, where the problem is, how to solve?

CodePudding user response:

Guess these systems have a special topic, in theme overrides the style

Test method: through the window messages received spyxx tool to view the corresponding software

CodePudding user response:

reference 1st floor lindexi_gd response:
guess these systems have a special topic, in theme overrides the style

Test method: through spyxx tools check the window corresponding software received message


In theme tried, no effect, the test panel received roller

CodePudding user response:

A: how many topics in? More change

Use spyxx? Receive the data
  •  Tags:  
  • C #
  • Related