On May 30, 1:57 pm, "Rob" <ro...@yahoo.comwrote:
Maybe I am missing something...
By setting the ControlBox Property to True, you allow the Control Box to
appear on the form...
If the ControlBox property is set to True, setting the MaximizeBox to False
will disable the Maximize property within the Control box (same goes for
Minimize Box).
Where is the property to disable the "CloseBox" ?
Is there a way to show the ControlBox, but disable the CloseBox ?
Hi Rob,
I've adapted the following code to VB.NET from this article:
http://www.codeproject.com/KB/cs/DisableClose.aspx
And here is the VB.NET one:
(Put the code just after "Public Class Form1")
Public Class Form1
Private Const CP_NOCLOSE_BUTTON As Integer = 512
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim noclose As CreateParams
noclose = MyBase.CreateParams
noclose.ClassStyle = CP_NOCLOSE_BUTTON
Return noclose
End Get
End Property
' Codes...
End Class
..and works.
Hope this helps,
Onur Güzel