CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Location
    Mississauga, CANADA
    Posts
    199

    Question Need an API for DataCombo

    Wonder if someone already has some code. I want to control when a user can access a bound combo's drop down list, similar to the TextBox Locked Property only via API. Not interested in using the Enabled property.
    Basically...
    .
    if bEditFlag = False
    <code to prevent the dropdown from operating>
    else
    <code to allow the dropdown to operate>
    end if
    .
    Anyone?
    Thanks
    Last edited by praymond; October 18th, 2002 at 11:35 AM.
    Paul

  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878
    You can use SendMessage API to dropdown th e combo


    Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long


    Public Sub DropDown(cbo As ComboBox, blnShow As Boolean)

    If blnShow Then
    SendMessageLong cbo.hwnd, CB_SHOWDROPDOWN, 1, ByVal 0&
    Else
    SendMessageLong cbo.hwnd, CB_SHOWDROPDOWN, 0, ByVal 0&
    End If

    End Sub


    Check your boolean and then collapse CB
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Apr 2001
    Location
    Mississauga, CANADA
    Posts
    199
    Thanks, I'll give it a try.
    Paul

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