|
-
Apr 11th, 2001, 01:54 PM
#1
Thread Starter
Lively Member
Option Explicit
I use the code below to detect if Combobox has changed. but it only can detect if I type in to combobox. I can not detect if I just simply click the combobox.
Please help, thanks very much
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 Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Const EM_GETMODIFY = &HB8
Private Sub Command1_Click()
Dim rc As Long
rc = FindWindowEx(Combo1.hwnd, 0, "Edit", vbNullString)
If SendMessage(rc, EM_GETMODIFY, 0, 0) Then
MsgBox "Changed"
End If
End Sub
-
Apr 11th, 2001, 02:28 PM
#2
Once method is to subclass your Form to catch the WM_COMMAND message. If lParam = Combo1.hWnd, then it changed.
-
Apr 11th, 2001, 02:50 PM
#3
Thread Starter
Lively Member
Need more
Could you elabrate a little bit more, I am really not smart enough to catch your idea. Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|