viatorg
New member
Hi all,
Trying to make a combobox get focus when you left click on another combobox while the list part is down of the other combobox. It takes two clicks now to give another combobox focus. I was thinking I could make the control have focus
where the cursor location is when I Left Mouse Down?
When you left mouse down or when the list part retracts
from the combo that you are on I could then catch
CBN_CLOSEUP, but doesnt seam to send the message all the time?
I have done alot of searching and find people telling to look at MSDN, but havent found that to be very helpful or any samples to see how to use this in VB.NET.
Can someone please help
Public Class MyComboBox
Inherits System.Windows.Forms.ComboBox
Private Const CBN_DROPDOWN = 7
Private Const CBN_CLOSEUP = 8
Private Const WM_COMMAND As Long = &H111
Private Const WM_LBUTTONDOWN As Integer = &H201 513
Public First As Boolean = False
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = CBN_CLOSEUP Then
Console.Write(m.Msg & " ComboBox Retracting List" & vbCrLf)
Maybe do something here to give control focus where
the cursor is located.
End If
MyBase.WndProc(m)
End Sub
End Class
Thanks
Gerry
Trying to make a combobox get focus when you left click on another combobox while the list part is down of the other combobox. It takes two clicks now to give another combobox focus. I was thinking I could make the control have focus
where the cursor location is when I Left Mouse Down?
When you left mouse down or when the list part retracts
from the combo that you are on I could then catch
CBN_CLOSEUP, but doesnt seam to send the message all the time?
I have done alot of searching and find people telling to look at MSDN, but havent found that to be very helpful or any samples to see how to use this in VB.NET.
Can someone please help
Public Class MyComboBox
Inherits System.Windows.Forms.ComboBox
Private Const CBN_DROPDOWN = 7
Private Const CBN_CLOSEUP = 8
Private Const WM_COMMAND As Long = &H111
Private Const WM_LBUTTONDOWN As Integer = &H201 513
Public First As Boolean = False
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = CBN_CLOSEUP Then
Console.Write(m.Msg & " ComboBox Retracting List" & vbCrLf)
Maybe do something here to give control focus where
the cursor is located.
End If
MyBase.WndProc(m)
End Sub
End Class
Thanks
Gerry