Click here to Skip to main content
12,451,446 members (60,155 online)
Click here to Skip to main content
Alternatives (4)
Add your own
alternative version

Tagged as

Stats

49.5K views
15 bookmarked
Posted

Disable the Close box on a form

, 18 Feb 2012 CPOL
Disable the Close box on a form

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

17 Feb 2012
Simon_Whale
This is purely a VB.NET version of what Griff posted Public Const CS_NOCLOSE As Integer = &H200 Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams Get Dim params As CreateParams = MyBase.CreateParams ...
1 Feb 2010
Brian Pendleton
I could be missing the point here, but I believe you could also override the OnClosing event.protected override void OnClosing(CancelEventArgs e){ // allow default behavior.. base.OnClosing(e); // test for whatever... // on fail, e.Cancel = true; // set some...
29 Jun 2011
charles henington
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...
29 Jun 2011
jwalker343
See a couple of Alternate ways & Original Thread here:Disable Close Button from Title bar of a Window[^]

License

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

Share

About the Author

OriginalGriff
CEO
Wales Wales
Born at an early age, he grew older. At the same time, his hair grew longer, and was tied up behind his head.
Has problems spelling the word "the".
Invented the portable cat-flap.
Currently, has not died yet. Or has he?

Pro
Pro
| | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 18 Feb 2012
Article Copyright 2010 by OriginalGriff
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid