Send Left Mouse Click-VBForums
Results 1 to 4 of 4

Thread: Send Left Mouse Click

  1. #1

    Thread Starter
    Addicted Member DanCool999's Avatar
    Join Date
    Jul 2006
    Posts
    141

    Arrow Send Left Mouse Click

    Ok i am using a list-tree-view and when you right click it opens a menu. However i want to send a mouse left click BEFORE the user right clicks so it selects that file that they right click on.

    Thanks
    Dan " "

    Visual Basic Professional 6.0

  2. #2

  3. #3

    Thread Starter
    Addicted Member DanCool999's Avatar
    Join Date
    Jul 2006
    Posts
    141

    Re: Send Left Mouse Click

    Tryed that, No that does not work all the time because it still won't select it sometimes if the user right clicks too fast on a file.
    Dan " "

    Visual Basic Professional 6.0

  4. #4
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Send Left Mouse Click

    Try this. Not left mouse click needed
    VB Code:
    1. Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    2.     Dim lvwItem As ListItem
    3.     If Button = vbRightButton Then
    4.         Set lvwItem = ListView1.HitTest(x, y)
    5.         If Not lvwItem Is Nothing Then
    6.             lvwItem.Selected = True
    7.             PopUpMenu mnuFile
    8.         End If
    9.     End If
    10. End Sub
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.