954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Disable Close(X in upper right corner) button on Form

I launch 2 programs within my application with PROGRAMNAME->Show. Let's call them Prog1 and Prog2. I have a dummy form that I use Application::Run to keep the software running. When 1 of the program closes, I call Application::Exit to shut down the application. This doesn't allow the other program to call Form_Closing. I want to disable the X in the upper right corner of Prog1 so that the user is forced to close using Prog2. Or, is there a way to call the Form_Closing event of Prog1 when Prog2 gets the X?

DotNetUser
Junior Poster in Training
69 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

This is dependent on the platform you are writing your program for, Windows/Linux/Mac. There are forums for this indiviual platforms if you go to the forum index and scroll down a ways. You may get an answer here, but you are much more likely to get a response in the forum for the specific OS you are writing for.

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 

And what compiler and version of that compiler are you using? Not all compilers are created equal.

Ancient Dragon
Retired & Loving It
Team Colleague
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
This is dependent on the platform you are writing your program for, Windows/Linux/Mac. There are forums for this indiviual platforms if you go to the forum index and scroll down a ways. You may get an answer here, but you are much more likely to get a response in the forum for the specific OS you are writing for.



Actually, our Windows, Linux, and Mac forums are geared more towards end-user technical support, so this is the place to be if you're looking for programming help.

cscgal
The Queen of DaniWeb
Administrator
19,424 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

I stand corrected. Supply the operating system/platform target and compiler information and hopefully someone with knowledge appropriate to that combination will be forthcoming.

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 

The target OS is Windows XP and I'm using Visual Studio .NET 2003. My code is being written in VC++.NET.

DotNetUser
Junior Poster in Training
69 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

remove the X button altogether in the form's properties. I don't recall which one -- probably System property.

Ancient Dragon
Retired & Loving It
Team Colleague
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

I believe that you're talking about FormBorderStyle. There's None that doesn't have the X, but this doesn't suit my needs. I need a form that can be resized.

DotNetUser
Junior Poster in Training
69 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Form property ControlBox is the one. When set to false, it hides the MIN, MAX, and Close buttons.

DotNetUser
Junior Poster in Training
69 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 
Form property ControlBox is the one. When set to false, it hides the MIN, MAX, and Close buttons.


Thanks a lot DonNetUser!:) I was having that problem earlier and I found this thread. Thanks again.

pixma
Newbie Poster
24 posts since Sep 2010
Reputation Points: 2
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You