Windows Titlebar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to remove the close icon on the title bar and replace it with
some other closing mechanism?
 
Arne said:
Is there a way to remove the close icon on the title bar and replace it
with
some other closing mechanism?

Add this to your form:

\\\
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const CS_DBLCLKS As Int32 = &H8
Const CS_NOCLOSE As Int32 = &H200
cp.ClassStyle = CS_DBLCLKS Or CS_NOCLOSE
Return cp
End Get
End Property
///

Alternatively you can remove the according menu items from the system menu
using p/invoke.
 
Back
Top