VB.NET - Disable Close (X) Button - Easy Way
This a simple tutorial I made today. Hope you like it


Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
e.Cancel = True
End Sub



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

e.Cancel = True