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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unusual behaviour - grid not scrolling with mouse wheel

Status
Not open for further replies.

AlastairP

Technical User
Feb 8, 2011
286
AU
I have an unusual problem with my grids.

When the grid has focus, the mouse wheel will scroll the grid up or down - sometimes, and sometimes not.
I check this by clicking on a row and then trying again - no luck.
After a few up and down movements of the mouse it will eventually start moving.
Then sometimes it will just work straight away.
I disabled any code in the grid to eliminate that possiblity, and it still showed the same behaviour.
I am using a cursor adaptor for the record source.

Update:
I just noticed another thing. The issue is as follows.
Click on a row and leave mouse in row/cell that I clicked on.
No Scrolling
I then move mouse out of the cell and presto - grid scrolls

Is this normal behaviour?


 
Well, I can reproduce that behaviour.

So the rule seems to be, the mouse wheel will scroll the control you hover, and if the column textbox has focus and you hover over it, that means scrolling the textbox, but as that has no scrolling, nothing scrolls, also not the parent grid.

So, if you know it you can simply move the mouse off the current control and scroll.

With EVENTTRACKING I see the text1.mousewheel event is triggered.

Bye, Olaf.

 
Yeah, we'd probably get all kinds of complaints if the scroll wheel was ignored in a multi-line editbox inside a grid, for example.

I've actually seen this behavior in other apps, notably browsers. I've inadvertently changed the selection in a dropdown list when I meant to scroll the page.

It's one of those things that makes sense intellectually, once you analyze the behavior, but on first glance maybe not so much. <shrug> (Sort of like REPLACE while at EOF(). <g>)
 
Thanks, that makes sense


Regards

Alastair
 
what you could do is THIS.PARENT.PARENT.DoScroll(?) FROM within the MouseWheel event of the textbox. I already treib BINDEVENT, but it seesm one of the events Bindevent does not forward an event the way it's needed to execute the default bahviour.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top