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

Mouse Wheel at Runtime

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,826
JP
I just noticed an odd behavior in my mouse and VFP. I have several grids on a form. When I am working in development mode (i.e. I'm running the app within VFP), the mouse wheel works as expected. (If I am over a grid, and I move the mouse wheel, the grid moves along with it, up and down). But if I run it as an .EXE the mouse wheel does nothing.
Any idea what causes this, and how to fix it? Anyone else have this same issue?

Ver: VFP 9 with all the SPs applied, Sedna applied, on Win10.


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
Hi,
The corresponding grid or one of its controls needs focus - just click on it
hth
MarK
 
Nope, that doesn't work.
And MouseEnter is all that's needed to tell the object that a mouse event is taking place.


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
Most controls react to mouse wheel, if you just hover them, even whole applications like notpad don't need to be activated before reacting to wheel events, it's sufficient you hover them.

But indeed VFP grids need to have focus before they react to mouse wheel events, also at design time.

Do you prevent focus to be on any column control? If you make use of AllowCellSelection=.f. instead of RETURN .F. in When events, the grid can get (readonly) focus and you can scroll it.

I don't see a difference between running in an EXE or within IDE, in form designer grids won't scroll, as they don't show data at all.

Bye, Olaf.

Olaf Doschke Software Engineering
 
This is another that is really bugging me, because everything you guys have said makes sense, but its still not working.
In fact, if I click the record in the gird to make sure the grid is not just in focus, but I've click on a row, and then try to move it with mouse wheel, it still does not move in the .EXE. I can only move it with the vertical scroll bar at the right (either clicking in the bar, or clicking the arrows at the end of the bar, but mouse wheel doesn't work when I'm over the bar either).
I'm beginning to think it is some kind of issue with drivers or the mouse I'm using, but that seems unlikely because it works when in the IDE...


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
BTW, I've resolved the need to click a grid to get the mouse wheel to work by just hovering with this code:

Code:
LPARAMETERS nButton, nShift, nXCoord, nYCoord
*
IF UPPER(ALLTRIM(WONTOP())) = UPPER(ALLTRIM(ThisForm.Name))
	This.SetFocus()
ENDIF

I've commented this out to see if this was an issue with the run time, but even when I click in the grid at runtime, mouse wheel is still not recognized. While running as an APP in the IDE, it works fine...


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top