To remove the control box, set the form's 'ControlBox' property to 'False'.
Add a handler to the form's 'Closing' event if you want to be notified when
the form closes. You can set 'e.Cancel = False' there to prevent the form
from closing.
I find it awful to do things that are in conflict what is beside the normal
habit from users (the same as a car without a steering wheel but a
joystick), however this solution from Mick looks acceptable for me.
\\\by Mick Doherty
Protected Overrides ReadOnly _
Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const CS_NOCLOSE As Integer = &H200
cp.ClassStyle = cp.ClassStyle Or CS_NOCLOSE
Return cp
End Get
End Property
///
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.