Topic: MouseWheel event

Hi,How to use MouseWheel envent to scroll the form?

Thank you!

Re: MouseWheel event

Hello.


Please download latest version, I have added event OnMouseWheel for form
https://www.dropbox.com/s/f3j4kfpnttm1o … b.zip?dl=0



Example project:

Post's attachments

Attachment icon OnWheelMouse.zip 3.14 kb, 409 downloads since 2017-05-30 

Dmitry.

Re: MouseWheel event

Thank you very much smile

Re: MouseWheel event

It does make the button to move, not the entire content of the form to scroll. How to you make the form scrolling with your method?

Re: MouseWheel event

tcoton wrote:

It does make the button to move, not the entire content of the form to scroll. How to you make the form scrolling with your method?

Change this line

if WheelDelta > 0 then Form1.Button1.Top := Form1.Button1.Top - 4 else Form1.Button1.Top := Form1.Button1.Top + 4;

to

if WheelDelta > 0 then Form1.VertScrollBar.Position := Form1.VertScrollBar.Position - 4 else Form1.VertScrollBar.Position := Form1.VertScrollBar.Position + 4; 
Dmitry.