Results 1 to 3 of 3

Thread: dropping down combo at runtime

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    israel
    Posts
    4

    Unhappy dropping down combo at runtime

    how can i manage my combo box to be automatically dropped down at run time (without click from the user)

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Code:
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const CB_SHOWDROPDOWN = &H14F
    
    Private Sub Command1_Click()
        'show dropdown
        Call SendMessage(Combo1.hWnd, CB_SHOWDROPDOWN, 1, 0) 
    End Sub

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    '''another way.
    Code:
    'Drop down a combobox when it gains focus
    
    Option Explicit
    
    Dim bAlreadyDown As Boolean  'used to drop
    
    Private Sub Form_Load()
    'some insignificant data
      Combo1.AddItem "List me 1"
      Combo1.AddItem "List me 2"
    End Sub
    
    
    Private Sub Combo1_DropDown()
      bAlreadyDown = True
    End Sub
    
    Private Sub Combo1_GotFocus()
      If bAlreadyDown = False Then SendKeys ("{f4}")
          bAlreadyDown = False
    End Sub
    
    Private Sub Combo1_LostFocus()
      bAlreadyDown = False
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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