CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Location
    brugge
    Posts
    67

    simulate mouseclick with keyboardbutton

    next to my controls I have a picture. When I click with the right mouse button on it an event will happen.

    When I use the tab and the tabindex is just there. and then I have to click on enter and the event will happen 2.

    so I have a button next to it is the picture. so I'm on the button I press tab and I'm on the picture then I have to press on enter and the event for that picture have to happen with pushing on the enter button.


    thx to the best.

    grtz
    enjoy every day of your life, don't listen to oters, make your life self!!!
    §The Chosen One§ @k@ Romèo

  2. #2
    Join Date
    Dec 2002
    Location
    London, UK
    Posts
    1,569
    sorry I didn't understand your question. I think you are asking how to trigger the PICTURE_CLICK event after pressing enter? yes?

    Well, in the KEYDOWN event you could place code to call the CLICK event if the enter button is pressed.
    Mike

  3. #3
    Join Date
    Mar 2003
    Location
    brugge
    Posts
    67
    Private Sub PicOpslaan_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyAscii = 13 Then
    ---->PicOpslaan_Click <-----
    End If
    End Sub


    How can I trigger then the picopslaan_click event????

    thx a lot
    enjoy every day of your life, don't listen to oters, make your life self!!!
    §The Chosen One§ @k@ Romèo

  4. #4
    Join Date
    Jul 2003
    Location
    I'm Here!
    Posts
    31
    I don't think KeyDown traps the enter key. Try the KeyPress event:

    If KeyAscii = vbKeyReturn then
    PicOpslaan_Click
    End If

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

Featured