Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Spinner control
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01431971
Message ID:
01431980
Views:
88
>Is there a way to use the spinner object with the MOUSEDOWN event to control the increment?
>I want the spinner to go up/down by 10 with [Shift]+mouse click, by 50 with [Ctrl]+mouse click, and by 100 with [Alt]+mouse click.
>But I don't see how I can tell if the [UP] or the [DN] button on the spinner was clicked to add or subtract.
>Colombo.
*** Mouse down event
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nButton == 1
****************************************************************************************************
********  You should declare this API in the INIT event of the form or somewhere at the beggining of your applicatioh
********  DECLARE SHORT GetKeyState IN WIN32API INTEGER
****************************************************************************************************
  #define VK_SHIFT    0x10
  #define VK_CONTROL  0x11
  #define VK_MENU     0x12 && This is ALT key
  lnAdd = 0
  DO CASE
     CASE GetKeyState( VK_CONTROL) < 0
          lnAdd = 50 - this.Increment && Just because at the Mouse Up this.Increment will be added
     CASE GetKeyState( VK_SHIFT)   < 0
          lnAdd = 10 - this.Increment
     CASE GetKeyState( VK_MENU)    < 0
          lnAdd = 100 - this.Increment
  ENDCASE
  this.Value = this.Value + lnAdd
ENDIF
NOT PROPERLY TESTED!
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform