Click here to Skip to main content
13,512,061 members
Click here to Skip to main content
Alternatives (4)
Add your own
alternative version

Tagged as


15 bookmarked
Posted 26 Jan 2010

Disable the Close box on a form

, 18 Feb 2012
Disable the Close box on a form


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

17 Feb 2012
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
See a couple of Alternate ways & Original Thread here:Disable Close Button from Title bar of a Window[^]


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


About the Author

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?

| | Privacy | Terms of Use | Mobile
Web04 | 2.8.180417.1 | Last Updated 18 Feb 2012
Article Copyright 2010 by OriginalGriff
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid