Catch Title bar double click

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

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
 
Marty said:
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
///
 
Thank you, exactly what I needed.
Marty
\\\
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
///
 
Back
Top