Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass-through mousewheel from control to form

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi!

I use the form-mousewheel(nDirection)event to skip forward/back through my records.
nDirection > 0 ---> skip 1
nDirection < 0 ---> skip -1
That works fine as long as the mousepointer is on the form.
Is there a way to pass through same behaviour even if a control on the form has focus?
Will bindevent do so ? I never used that....

-Bart
 
Yes, you could bind the MouseWheel event of each control on the form to the form's MouseWheel event.

Tamar
 
Tamar,
That;s what I thought.
Would you give me a hand on this for the help-file is a bit weird on this.
-Bart
 
First: before you event attempt Bindevent(), make sure all your controls are sub-classes, or you will be pulling your hair out.

***Forms INIT()
**nDirection > 0 ---> skip 1
**nDirection < 0 ---> skip -1

***Controls INIT()
Bindevent(This,"MouseWheel",Thisform,"MouseWheel")

Thats all to it...
 
Sorry:
NOT: ***Forms INIT() BUT
**** Forms.Mousewheel()
**nDirection > 0 ---> skip 1
**nDirection < 0 ---> skip -1

 
ImagineCorp,
Thanks.
In my class lib I tailored bit more enabeling to turn off 'on request' this behaviour.

IF this.lBindMousewheelToForm
Bindevent(This,"MouseWheel",Thisform,"MouseWheel")
ENDIF

Any way THANKS for pointing me to the syntax.

-Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top