Just off the top of my head....
Override the WndProc so that you can trap the WM_NCHITTEST and WM_NCPAINT
messages.
Paint your own title bar without the close button in the handler for
WM_NCPAINT
Prevent the detection of the close button in the WM_NCHITTEST.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
<oh******@netvision.net.il> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hello,
I have an MDI child, which I need to be opened as long as the mainframe
is opened. The problem is that the user can close it using the X button
in the form's top-right edge.
How can I make this button disappear, or at least disabled?
I'm using C# with .NET Framework 2.0.
Thanks a lot!