-
February 4th, 2006, 12:37 AM
#1
URGENT subclassing an ImageCombo
I have a UserControl, which I have subclassed.
I am trying to catch when an ImageCombo dropdown is closedup
Here is a copy of the subclass function
Code:
Const WM_COMMAND = &H111
Const CBN_CLOSEUP = 7
Friend Function WindowProc(ByVal hwnd As Lon, ByVal iMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If (iMsg = WM_COMMAND) Then
If (lParam <> 0) Then
ctrlIndex = (wParam And &HFFF&) -1
If (ctrlIndex > -1) Then
Set ctrl = Controls(ctrlIndex)
If (TypeOf ctrl Is ImageCombo) Then
cmdCode = (wParam And &HFFFF0000) / &H10000
If (cmdCode = CBN_CLOSEUP) Then
'Some Code Here
End If
End If
End If
End If
End If
WindowProc = CallWindowProc(GetProp(hWnd, "OldWindowProc"), hwnd, iMsg, wParam, lParam)
End Function
The subclassing of the UserControl works, however I am not trapping when the ImageCombo dropdown closes.
If I replace the ImageCombo for a ComboBox and change the relevant line of code, it works.
So I think I might not be trapping the proper messages
All code on this page is protected by an SEP field!!!
-
February 4th, 2006, 01:04 AM
#2
Re: URGENT subclassing an ImageCombo
Ok i figured it out shoudl not subtract -1 from ctlIndex
and should test if ctrlIndex > -1
All code on this page is protected by an SEP field!!!
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
|