Using Mousewheel----help needed?
-
hey, I want to use MouseWheel for my drawing application...Idea is to expand and contract a circle depending upon the direction of wheel motion...which function/property to use..? thanks
-
hey, I want to use MouseWheel for my drawing application...Idea is to expand and contract a circle depending upon the direction of wheel motion...which function/property to use..? thanks
Hi, there are at least two approaches to do such things. 1. Every shape (line, rectangle, circle, ...) could be a (user-defined) Control; in that case you create and select a shape, then it gets its events fired such as MouseWheel. 2. In a lightweight approach (which I prefer) only one Control is involved (say a Panel) on which you create your drawing. Now it is the Panel itself that gets the events, such as MouseWheel. In both cases, the MouseEventArgs.Delta property will tell you how much the wheel has moved (and the sign of that will tell the direction). You should follow UI design rules as explained in MSDN, concerning SystemInformation.MouseWheelScrollLines :)
Luc Pattyn [My Articles] [Forum Guidelines]