0

Friends, In VB.net Form properties, There are Maximize Box and Minimize Box.If we make them false, those prperties will be disabled.Likewise there is a Close Box at the right top corner of the form.How can we disable this? Is there any way at design time to disable this? If not,Can we disable it through code?

3
Contributors
3
Replies
12
Views
3 Years
Discussion Span
Last Post by mavtcr
0

In the FormClosing you could always do

e.Cancel = True

But you should also give the user some other way to exit. For example, if the user selects Exit from a menu you could set a class flag as in

Private ReallyExit As Boolean = False

Private Sub Form1_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
    e.Cancel = ReallyExit
End Sub

Just make sure that somewhere in your code you do

ReallyExit = True

Edited by Reverend Jim

0

Thank you all ..Making Formboarder style to None is easier and convenient..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.