Thread Subject: How do I disable the Windows Close Button in a GUI?

Subject: How do I disable the Windows Close Button in a GUI?

From: William

Date: 26 Jun, 2009 21:35:02

Message: 1 of 3

I have a GUI that uses three separate windows; a main window and two auxiliary windows. When the aux windows are not being used, they are still open, but set to invisible. I am trying to make it impossible for the user to close the window using the Windows red "X" Close button in the top right of the Window. If the user clicks on the Close button the window can never be opened again as data is lost. I would like to either:

1) Disable the Close button to force the user to press a Close button I have created which just makes the window invisible, or

2) Program the close button to make the window invisible directly.

Is there a way to disable or modify the properties of the Windows Close button?

Thank you,
Billy

Subject: How do I disable the Windows Close Button in a GUI?

From: Nathan

Date: 26 Jun, 2009 21:39:07

Message: 2 of 3

On Jun 26, 2:35 pm, "William" <w_kin...@yahoo.com> wrote:
> I have a GUI that uses three separate windows; a main window and two auxiliary windows. When the aux windows are not being used, they are still open, but set to invisible. I am trying to make it impossible for the user to close the window using the Windows red "X" Close button in the top right of the Window. If the user clicks on the Close button the window can never be opened again as data is lost. I would like to either:
>
> 1) Disable the Close button to force the user to press a Close button I have created which just makes the window invisible, or
>
> 2) Program the close button to make the window invisible directly.
>
> Is there a way to disable or modify the properties of the Windows Close button?
>
> Thank you,
> Billy
Check here:
http://www.mathworks.co.kr/matlabcentral/newsreader/view_thread/165498
For the close request function, just set that window's visibility to
off.

Hope this works for you.
-Nathan

Subject: How do I disable the Windows Close Button in a GUI?

From: William

Date: 26 Jun, 2009 21:51:01

Message: 3 of 3

Nathan <ngreco32@gmail.com> wrote in message <7cde863a-b0ea-4eed-885e-11adf6e3117f@x1g2000prh.googlegroups.com>...
> On Jun 26, 2:35 pm, "William" <w_kin...@yahoo.com> wrote:
> > I have a GUI that uses three separate windows; a main window and two auxiliary windows. When the aux windows are not being used, they are still open, but set to invisible. I am trying to make it impossible for the user to close the window using the Windows red "X" Close button in the top right of the Window. If the user clicks on the Close button the window can never be opened again as data is lost. I would like to either:
> >
> > 1) Disable the Close button to force the user to press a Close button I have created which just makes the window invisible, or
> >
> > 2) Program the close button to make the window invisible directly.
> >
> > Is there a way to disable or modify the properties of the Windows Close button?
> >
> > Thank you,
> > Billy
> Check here:
> http://www.mathworks.co.kr/matlabcentral/newsreader/view_thread/165498
> For the close request function, just set that window's visibility to
> off.
>
> Hope this works for you.
> -Nathan


Hi Nathan,

Thanks! I forgot about that function. Silly me! Thanks for the quick response...I will fix this once and for all when I get home.

Billy

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gui William 26 Jun, 2009 17:39:02
close button William 26 Jun, 2009 17:39:02
figure William 26 Jun, 2009 17:39:02
invisible William 26 Jun, 2009 17:39:02
active William 26 Jun, 2009 17:39:02
superman William 26 Jun, 2009 17:39:02
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com