Results 1 to 9 of 9

Thread: Picturebox Mousedown button check?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2003
    Posts
    135

    Picturebox Mousedown button check?

    What im trying to do is check which button is clicked and set the fillcolor based on that can anyone help?

    Picture1.DrawWidth = Text1.Text
    If Button = 1 Then Picture1.FillColor = Picture2.BackColor
    If Button = 1 Then Picture1.Line -(x, y)
    If Button = 2 Then Picture1.FillColor = Picture3.BackColor
    If Button = 2 Then Picture1.Line -(x, y)

    Thanks

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Are you having array of buttons ?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2003
    Posts
    135
    no button 1 = right mouse button
    button 2 = left mouse button

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Hmm , try this now .
    VB Code:
    1. Private Sub Form1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    2.  
    3. Picture1.DrawWidth = Text1.Text
    4. If Button = 1 Then Picture1.FillColor = Picture2.BackColor
    5. If Button = 1 Then Picture1.Line -(x, y)
    6. If Button = 2 Then Picture1.FillColor = Picture3.BackColor
    7. If Button = 2 Then Picture1.Line -(x, y)
    8.  
    9. End Sub

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2003
    Posts
    135
    thats exactly what im using and its not working..

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Oh , I meant Picture MouseDown event not the form , have you tried this :

    VB Code:
    1. Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.  
    3.  
    4. End Sub

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Mar 2003
    Posts
    135
    yes i know it doesnt work thow you try make 2 pic box's with 2 different back colors and one to draw on

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    MouseClick isn't your problem then . Is this what you are doing ?
    Attached Files Attached Files

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Mar 2003
    Posts
    135
    yes i know it doesnt work thow you try make 2 pic box's with 2 different back colors and one to draw on

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width