Results 1 to 3 of 3

Thread: Detecting the mouse click event with a combo box control

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Location
    California
    Posts
    203
    Does anyone know if there is a mouse click event fired when a combo box dropdown is clicked. The click event seems to fire only when something is selected from the dropdowm list. But if nothing is selected the event appears not to happen.

    I need a way to detect the click event even if nothing is selected or no changes are made to the selection.

    Can anyone help?

  2. #2
    Guest
    Using the GetQueueStatus API function, you can detect when the mouse has clicked the Combobox.


    Code:
    Private Declare Function GetQueueStatus _
    Lib "user32" (ByVal fuFlags As Long) As Long
    
    Private Const QS_HOTKEY = &H80
    Private Const QS_KEY = &H1
    Private Const QS_MOUSEBUTTON = &H4
    Private Const QS_MOUSEMOVE = &H2
    Private Const QS_PAINT = &H20
    Private Const QS_POSTMESSAGE = &H8
    Private Const QS_SENDMESSAGE = &H40
    Private Const QS_TIMER = &H10
    Private Const QS_ALLPOSTMESSAGE = &H100
    Private Const QS_MOUSE = (QS_MOUSEMOVE Or QS_MOUSEBUTTON)
    Private Const QS_INPUT = (QS_MOUSE Or QS_KEY)
    Private Const QS_ALLEVENTS = (QS_INPUT Or QS_POSTMESSAGE Or QS_TIMER Or QS_PAINT Or QS_HOTKEY)
    Private Const QS_ALLINPUT = (QS_SENDMESSAGE Or QS_PAINT Or QS_TIMER Or QS_POSTMESSAGE Or QS_MOUSEBUTTON Or QS_MOUSEMOVE Or QS_HOTKEY Or QS_KEY)
    
    
    Private Sub Combo1_Click()
    
        If GetQueueStatus(QS_MOUSE) Then
            MsgBox "Selected item:  " & _
            Combo1.List(Combo1.ListIndex), _
            vbInformation, "Mouse down on Combobox."
        End If
        
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Location
    California
    Posts
    203
    That doesn't work, because like i said, the combo1.click event is not detected if i don't select an item from the list. I need to detect that the mouse was clicked without using the combo1_click event.

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