Close form button on visual basic 2008

How to remove the close button on the top of the forms?
Jose BredariolPMPAsked:
Who is Participating?
 
Alex_WConnect With a Mentor Commented:
If you wanted to keep the minimize button but disable the others add this to your code:
 
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
0
 
Alex_WConnect With a Mentor Commented:
You can change the Form Border Style proptery to none.
0
 
ZhaolaiConnect With a Mentor Commented:
Set Form's ControlBox property = False.
0
 
Jose BredariolPMPAuthor Commented:
Thanks all
0
All Courses

From novice to tech pro — start learning today.