Webnode

Visual Basic - Remove Close Button

Hello !
In this tutorial I'll teach you how you can disable/remove the close button on your windows form applications !

Start by opening or creating a windows form application.
 

Go to your design of form1 and click the events button at the formproperties.

 

Look for the event called "formclosing"

 

Double click the event and enter the following code:

If e.CloseReason = CloseReason.UserClosing Then

            e.Cancel = True

        End If

This code basically means that the User can no longer close the form, but he can still close it using the taskmanager.

If you now run your project and click the close button, it won't close!

You can also remove the close button by setting Controlbox to false in form1 properties:


Webnode

Topic: Visual Basic - Remove Close Button

Date: 30/03/2013

By: Abu Taleb

Subject: Thanks

Hi, My name is AUTALEB from BANGLADESH. i just prayer and i can say to you god bless you.

Reply

—————

Date: 11/01/2013

By: fadzy kay

Subject: thnx

thanx alot, your a life saver.

Reply

—————

Date: 24/07/2012

By: mohan

Subject: Hide Close button on Form - C#

This link helps me to solve the issue,
http://www.trace-solution.com/2012/07/Disable-Close-Button-On-Form.html

Reply

—————