Article View: borland.public.cppbuilder.nativeapi
Article #4446Re: Modal Form in MDI Application
From: Hans Galema
Date: Wed, 25 Jan 2006 13:52
Date: Wed, 25 Jan 2006 13:52
40 lines
2195 bytes
2195 bytes
saravanan wrote:
> I have 3 child windows in my MDI application. When a button is clicked
> on first child, i will display a MODAL form. Since the invoked form is
> MODAL, i could not able to operate on any of the child form. Is there any
> way to override this ? I need to operate on other 2 child form. In other
> words, Form that invokes the modal form should alone be blocked and all
> other child windows should be operatable. How to do this ?
Do not show that form modal but make FormStyle fsStayOnTop and use ->Show().
Disable that child. Enable again when the fsStayOnTop is closed:
//fsMDIChild
void __fastcall TForm3::Button1Click(TObject *Sender)
{
TForm4 *Form = new TForm4(this );
Enabled = false;
Form->Show();
}
//fsStayOnTop
void __fastcall TForm4::FormCloseQuery(TObject *Sender, bool &CanClose)
{
TForm *Form = dynamic_cast<TForm*>(Owner);
if ( Form )
Form->Enabled = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::FormClose(TObject *Sender, TCloseAction &Action)
{
Action = caFree;
}
Hans.
Technical Details
Message-ID:
<43d78296@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43d777fd@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4e4d4e40aee3f82a X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 25 Jan 2006 14:52:44 +0100 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Modal Form in MDI Application References: <43d777fd@newsgroups.borland.com> In-Reply-To: <43d777fd@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 145.98.201.248 Message-ID: <43d78296@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1138197142 145.98.201.248 (25 Jan 2006 05:52:22 -0700) Lines: 40 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail