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 usein 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 triedCode:SendMessage cbo.hwnd, CB_SHOWDROPDOWN, 1, 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?Code:SendMessage cbo.hwnd, CB_SHOWDROPDOWN, 0, 0&
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 triedin the grid's Click event for when the second column is clicked but it does not work neither.Code:SendMessage cbo.hwnd, CB_SHOWDROPDOWN, 0, 0&
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





Reply With Quote