MouseMove position

Discussion in 'Questions (Windows Mobile)' started by eww245, Apr 12, 2009.

  1. eww245

    eww245 Member Licensed User

    Is there anyway to detect if a MouseMove event is going up or down?

    If the first value, moving down, is less than the new value, it would be moving up.

    One option is with a Door event to get one property and _MouseMove to get the other.

    Another way is calling a Sub from _MouseMove to save the Y position and check the new value against it.

    In both situations saving it in a Global var.
    The result is always the same value.
    MouseUp and MouseDown obviously work, but not with MouseMove.

    I just want a ImageButton to show a value based on the Y location and to decrease when moving Up.

    .NET "Control.MousePosition.Y" might help, but I expect it would return the same result.

    Any Thoughts?
     
  2. agraham

    agraham Expert Licensed User

    I'm not sure what your problem is. This works for me
    Code:
    Sub Globals
       
    'Declare the global variables here.
       oldY = 0
    End Sub

    Sub App_Start
       Form1.Show
    End Sub


    Sub Form1_MouseMove(x, y)
       oy = oldy
       oldy = y
       
    If y < oy Then
          Label1.Text = 
    "Going up!"
       
    Else If y > oy
          Label1.Text = 
    "Going down!"
       
    Else
          Label1.Text = 
    "Going nowhere!"   
       
    End If
    End Sub
     
  3. eww245

    eww245 Member Licensed User


    Well I missed the oy = oldy
    Thanks, it works.

    Now another question.

    I'm having trouble with args()
    The only way a command line seems to work is
    Code:
    If ArrayLen(args())=2 then Form1.Show Else msgbox("NoForm")
    How can the argument be saved, or read?

    Code:
    For.....
       
    If args(i) = -ShowTheForm then Form1.Show Else msgbox("NoForm")
    Next
    Index Out Of Range
     
  4. agraham

    agraham Expert Licensed User

    Like this
    Code:
    If ArrayLen(args()) > 0 Then
          
    For i = 0 To ArrayLen(args()) - 1
             msg = msg & args(i) & 
    CRLF
          
    Next
       
    Else
          msg = 
    "No arguments"
       
    End If
       
    Msgbox(msg)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice