Click here to Skip to main content
15,881,881 members
Articles / Programming Languages / Visual Basic
Alternative
Tip/Trick

Disable the Close box on a form

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
29 Jun 2011CPOL 5.3K  
I have used this in the past and have also posted as one of my tip tricks :-} One tip trick that I still like with CreateParams is changing parms.ClassStyle |= 0x200; to parms.ClassStyle = this.Handle.ToInt32(); which will render the form invisible which is much easier than overriding...
I have used this in the past and have also posted as one of my tip tricks :-}
One tip trick that I still like with CreateParams is changing
C#
parms.ClassStyle |= 0x200;

to
C#
parms.ClassStyle = this.Handle.ToInt32();

which will render the form invisible which is much easier than overriding
C#
SetVisibleCore(bool value)

because you then have to have another bool value to ensure the FormLoad Event is called.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I do not claim to be wrong! I just rarely ever write.

Comments and Discussions

 
-- There are no messages in this forum --