Path: news.mathworks.com!not-for-mail
From: "William" <w_king10@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I disable the Windows Close Button in a GUI?
Date: Fri, 26 Jun 2009 21:51:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 26
Message-ID: <h23fs5$g86$1@fred.mathworks.com>
References: <h23eu6$fqs$1@fred.mathworks.com> <7cde863a-b0ea-4eed-885e-11adf6e3117f@x1g2000prh.googlegroups.com>
Reply-To: "William" <w_king10@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246053061 16646 172.30.248.38 (26 Jun 2009 21:51:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 26 Jun 2009 21:51:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 930703
Xref: news.mathworks.com comp.soft-sys.matlab:551010


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