Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / VB

Disable the Close box on a form

0.00/5 (No votes)
29 Jun 2011CPOL 5.4K  
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)