ommer
asked on
windows toolbar dropdown button
Dear Dotnet Experts,
I have developed a window app in vs2003. On this form I have a toolbar. One of the button is of dropdown style. As it is right now, mouse clicks on the main icon area of the button will do nothing. Only clicks to its arrow down area (the narrower strip on right side) will make the dropdown menu show.
Does any one know how to make the click on the main icon area has the same effect as clicking on the down arrow?
Thanks!
I have developed a window app in vs2003. On this form I have a toolbar. One of the button is of dropdown style. As it is right now, mouse clicks on the main icon area of the button will do nothing. Only clicks to its arrow down area (the narrower strip on right side) will make the dropdown menu show.
Does any one know how to make the click on the main icon area has the same effect as clicking on the down arrow?
Thanks!
ASKER
How do you declare WM_NCLBUTTONDOWN and HTCAPTION?
and, I am talking about Toolbar, and you were refering to TitleBar... They all work the same?
Thank you for your reply!
and, I am talking about Toolbar, and you were refering to TitleBar... They all work the same?
Thank you for your reply!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are great!
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Messa
Try
Select Case m.Msg
Case WM_NCLBUTTONDOWN
If m.WParam.ToInt32 = HTCAPTION Then
MsgBox("Titlebar clicked")
'here you can do your stuff
End If
End Select
MyBase.WndProc(m)
Catch ex As Exception
MsgBox(ex.Message)
End Try
MyBase.WndProc(m)
End Sub