Groups | Blog | Home
all groups > vb.net > april 2005 >

vb.net : Catch Title bar double click


Marty
4/1/2005 8:59:01 PM
Hi,

I stuck on basic thing today...

How can I caych the double click event when it is done on the title bar
of a form. I just want my form to be expanded or shrinked when the user
dbl-click.

Thanks,
Marty
4/1/2005 9:35:10 PM
Thank you, exactly what I needed.
Marty

[quoted text, click to view]
Crouchie1998
4/1/2005 10:16:46 PM
Look up the HTCAPTION constant

Crouchie1998
BA (HONS) MCP MCSE



[quoted text, click to view]

Herfried K. Wagner [MVP]
4/1/2005 11:16:55 PM
"Marty" <xmarty99@hotmail.com> schrieb:
[quoted text, click to view]

\\\
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Static Expanded As Boolean = True
Static Height As Integer
Const WM_NCLBUTTONDBLCLK As Int32 = &HA3
If m.Msg = WM_NCLBUTTONDBLCLK Then
If Expanded Then
Height = Me.Height
Me.Height = 0
Else
Me.Height = Height
End If
Expanded = Not Expanded
End If
MyBase.WndProc(m)
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button