65.9K
CodeProject is changing. Read more.
Home

Disable the Close box on a form

starIconstarIconemptyStarIconemptyStarIconemptyStarIcon

2.00/5 (1 vote)

Jun 27, 2011

CPOL
viewsIcon

5482

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
parms.ClassStyle |= 0x200;
to
parms.ClassStyle = this.Handle.ToInt32();
which will render the form invisible which is much easier than overriding
SetVisibleCore(bool value)
because you then have to have another bool value to ensure the FormLoad Event is called.