Help! How do I make a "between" character?

Discussion in 'Questions (Windows Mobile)' started by WhiteRussianBC, Nov 8, 2008.

  1. WhiteRussianBC

    WhiteRussianBC New Member Licensed User

    I need some help making a "between" character. Im making an application wich will do one thing when you press the right side of the form and another thing when you press the left side.

    Heres what I tried:
    (THE COORDINATES ARE NOT CORRECT IN THIS EXAMPLE)

    Code:
    Sub Form1_MouseDown (x,y)
    If x = 0 <> 80 Then
    msgbox ("Left side")
    Else if x = 80 <> 150 then
    msgbox ("Right side")
    End If
    End Sub
    And it doesen't work. Well, you see my problem. I need:
    If x = between 0 to 80 Then...

    Please help
     
  2. agraham

    agraham Expert Licensed User

    Try something like
    Code:
    Sub Form1_MouseDown (x,y)
      
    If x < 120 Then
       
    msgbox ("Left side")
      
    Else
        
    msgbox ("Right side")
      
    End If
    End Sub
    Or three zones

    Code:
    Sub Form1_MouseDown (x,y)
      
    If x < 80 Then
        
    msgbox ("Left side")
      
    Else if x >= 80 AND x<160 then
        
    msgbox ("Middle")
      
    Else
        
    msgbox ("Right side")
      
    End If
    End Sub
     
  3. N1c0_ds

    N1c0_ds Active Member Licensed User

    Or you can set it with MouseUp. This way you can put visual feedback in the mousedown event (like show the "clicked" pictures) and actual actions in the mouseup event.
     
  4. WhiteRussianBC

    WhiteRussianBC New Member Licensed User

    Thank you very much, Agraham. That solved my problem
     
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