By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,348 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

Catch Title bar double click

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Marty" <xm******@hotmail.com> schrieb:
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.


\\\
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/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2

P: n/a
Look up the HTCAPTION constant

Crouchie1998
BA (HONS) MCP MCSE

"Marty" <xm******@hotmail.com> wrote in message
news:pCi3e.125552$ZO2.98148@edtnps84...
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

Nov 21 '05 #3

P: n/a
Thank you, exactly what I needed.
Marty

Herfried K. Wagner [MVP] wrote:
"Marty" <xm******@hotmail.com> schrieb:
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.

\\\
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
///

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.