VB.NET - Disable Close (X) Button - Easy Way

Posts 1–15 of 22 · Page 1 of 2
VB.NET - Disable Close (X) Button - Easy Way
This a simple tutorial I made today. Hope you like it

GJ, but i hate Video Tutorials
I only like text Tutorials
Quote Originally Posted by CFHackerExtreme View Post
GJ, but i hate Video Tutorials
I only like text Tutorials
You can copy&paste the code from the description

Thank you
Quote Originally Posted by Matroix73 View Post


You can copy&paste the code from the description

Thank you
I don`t C&P that cuz i have another methode to diasble it
is This an easy way ?
So What about This :
Code:
 Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        e.Cancel = True
    End Sub
and That's how The Close Button will Get Disabled and wont have the Chance to Function !
and EASIER !!

Anyways, Good Job
Quote Originally Posted by steveroseik View Post
is This an easy way ?
So What about This :
Code:
 Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        e.Cancel = True
    End Sub
and That's how The Close Button will Get Disabled and wont have the Chance to Function !
and EASIER !!

Anyways, Good Job
Now your form just won't close at all unless via task manager or something like that
Quote Originally Posted by DawgiiStylz View Post

Now your form just won't close at all unless via task manager or something like that
NOpe

If I Made a String in My.Settings and toggle its value between 1 and 0
Soo >
Code:
 Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
if My.settings.Tvalue = "0" then

e.Cancel = True
ElseIf My.Settings.Tvalue = "1" then
e.Cancel = false
        End if
    End Sub
And Now I Can Choose wether The Button Closes or Not at anytime
Quote Originally Posted by steveroseik View Post


NOpe

If I Made a String in My.Settings and toggle its value between 1 and 0
Soo >
Code:
 Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
if My.settings.Tvalue = "0" then

e.Cancel = True
ElseIf My.Settings.Tvalue = "1" then
e.Cancel = false
        End if
    End Sub
And Now I Can Choose wether The Button Closes or Not at anytime
Then what would change the value of the setting?
Quote Originally Posted by DawgiiStylz View Post

Then what would change the value of the setting?
It Could Be a Button, Timer, ANYTHING with this code :
Code:
my.settings.Tvalue = 0
'or
my.settings.Tvalue = 1
Why don't use borderless forms and make your custom buttons looks much better than a disabled button :x
Quote Originally Posted by wGRWGHWGRERGrgergergrg View Post
Why don't use borderless forms and make your custom buttons looks much better than a disabled button :x
I'm going to make a tutorial on how to design your own form, very simple way
for beginners
Quote Originally Posted by Matroix73 View Post


I'm going to make a tutorial on how to design your own form, very simple way
for beginners
i don't need any tut's i know how to do
Code:
e.Cancel = True
This makes the button looks available to press but it won't close. but my method makes the button like its not enabled.
Why make a video for such a short piece of code?
Video for this little code ?
Posts 1–15 of 22 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us