如何利用API判断ComboBox是否处于下拉状态
如何利用API判断ComboBox是否处于下拉状态呢?
因为我的程序中,如果ComboBox处于下拉状态时,
需要暂停,只有ComboBox选定值了,再继续执行。
谢谢
[解决办法]
Private Const CB_GETDROPPEDSTATE As Long = &H157
SendMessage(combox1.hwnd, CB_GETDROPPEDSTATE, 0, ByVal 0) = 0
返回值是0,说明是在drop-down状态。
Public Property Get Dropped() As Boolean
If m_eStyle > cboSimple Then
If m_hWnd Then Dropped = CBool(SendMessage(m_hWnd, CB_GETDROPPEDSTATE, 0, 0))
End If
End Property
Public Property Let Dropped(ByVal bNew As Boolean)
If m_eStyle > cboSimple Then
If m_hWnd Then SendMessage m_hWnd, CB_SHOWDROPDOWN, -bNew, 0
End If
End Property