Results 1 to 16 of 16

Thread: [RESOLVED] Cannot Retract Combo Box Dropdown List

Threaded View

  1. #1

    Thread Starter
    Lively Member Phantom1's Avatar
    Join Date
    Nov 2011
    Posts
    64

    Resolved [RESOLVED] Cannot Retract Combo Box Dropdown List

    A combo box is placed within a MSFlexGrid so that when I click on the grid, the dropdown list appears and I can make a selection. For that, I use
    Code:
    SendMessage cbo.hwnd, CB_SHOWDROPDOWN, 1, 0&
    in the grid's Click event for when the first column is clicked, and it works. However, unless I make a selection from the list, I cannot click anywhere else on the grid to cause the list to retract. If I make a selection, the list retracts. If I make no selection, the list retracts only if I click outside the grid. I have tried
    Code:
    SendMessage cbo.hwnd, CB_SHOWDROPDOWN, 0, 0&
    in the LostFocus event of the combo box but clicking somewhere else in the grid does not activate this event and the list keeps appearing. What is wrong?

    Here is an image to clarify the situation:



    If I click in the column "Description", the combo box remains as it is in the column "Part No.". I have also tried
    Code:
    SendMessage cbo.hwnd, CB_SHOWDROPDOWN, 0, 0&
    in the grid's Click event for when the second column is clicked but it does not work neither.

    I need to know how to make the list retract when I click anywhere else in the grid, without any selection made in the combo box. Thanks in advance.

    [SendMessage is declared in the General section of the form, as follows:

    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
    ]
    Last edited by Phantom1; Nov 22nd, 2011 at 09:10 AM.

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