PDA

View Full Version : Mouse Wheel



Babak-Aghili
شنبه 08 مرداد 1384, 22:02 عصر
سلام .



private void listBox1_MouseWheel(object sender, MouseEventArgs e)
{
if(listBox1.SelectedIndex == listBox1.Items.Count-1)
listBox1.SelectedIndex = 0;
else
listBox1.SelectedIndex += 1;
}


خب ...

حالا چجوری بفهمم که این ماسماسک را به سمت بالا حرکت داده یا پایین ؟

Babak-Aghili
شنبه 08 مرداد 1384, 22:09 عصر
مرسی ... متوجه شدم .... عجالت ( عجول بودن ! ) من را ببخشید.

یک راهش اینه که ببینیم مقدار Delta مثبت هست یا منفی ...

البته اگه راه اصولی دیگه ای داره اون را دیگه نمیدونم...

dot_net_lover2
یک شنبه 09 مرداد 1384, 10:14 صبح
میشه بگی منظورت از Delta چی است ؟؟؟؟

Babak-Aghili
یک شنبه 09 مرداد 1384, 21:05 عصر
e.Delta

Gets a signed count of the number of detents the mouse wheel has rotated. A detent is one notch of the mouse wheel

The mouse wheel combines the features of a wheel and a mouse button. The wheel has discrete, evenly-spaced notches. When you rotate the wheel, a wheel message is sent as each notch is encountered. One wheel notch, a detent, is defined by the windows constant WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.

Currently, a value of 120 is the standard for one detent. If higher resolution mice are introduced, the definition of WHEEL_DATA might become smaller. Most applications should check for a positive or negative value rather than an aggregate total.

dot_net_lover2
یک شنبه 09 مرداد 1384, 23:00 عصر
ممنون بابک جان