<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Form2 nur bei aktiver Form1]]></title><description><![CDATA[<p>Hallo.</p>
<p>Ich habe ein main Fenster und ein sub Fenster.<br />
Das sub Fenster soll nur bei aktiviertem main Fenster sichtbar sein.<br />
Gelöst habe ich dies über Application-&gt;OnDeactivate/OnActivate.</p>
<p>Mein Problem ist jetzt, das wenn ich aus der SysTray zum Beispiel meinen E-Mail Client (TheBat) per einfach Click aufrufe, plötzlich Form2 wieder auftaucht, obwohl ja die Anwendung keinen Fokus besitzt. Störend ist das dahingehend, da Form2 &quot;AlwaysOnTop&quot; ist.</p>
<p>Inwiefern ist dies ein Bug und wie löst man das am Besten?</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
Application-&gt;OnDeactivate = deaktiviert;
    Application-&gt;OnActivate = aktivieren;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::deaktiviert(TObject *Sender)
{
	Form2-&gt;Hide();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::aktivieren(TObject *Sender)
{
	Form2-&gt;Show();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/117771/form2-nur-bei-aktiver-form1</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Jul 2026 04:27:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/117771.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Aug 2005 08:24:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Form2 nur bei aktiver Form1 on Thu, 11 Aug 2005 08:24:14 GMT]]></title><description><![CDATA[<p>Hallo.</p>
<p>Ich habe ein main Fenster und ein sub Fenster.<br />
Das sub Fenster soll nur bei aktiviertem main Fenster sichtbar sein.<br />
Gelöst habe ich dies über Application-&gt;OnDeactivate/OnActivate.</p>
<p>Mein Problem ist jetzt, das wenn ich aus der SysTray zum Beispiel meinen E-Mail Client (TheBat) per einfach Click aufrufe, plötzlich Form2 wieder auftaucht, obwohl ja die Anwendung keinen Fokus besitzt. Störend ist das dahingehend, da Form2 &quot;AlwaysOnTop&quot; ist.</p>
<p>Inwiefern ist dies ein Bug und wie löst man das am Besten?</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
Application-&gt;OnDeactivate = deaktiviert;
    Application-&gt;OnActivate = aktivieren;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::deaktiviert(TObject *Sender)
{
	Form2-&gt;Hide();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::aktivieren(TObject *Sender)
{
	Form2-&gt;Show();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/849902</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849902</guid><dc:creator><![CDATA[Stevens]]></dc:creator><pubDate>Thu, 11 Aug 2005 08:24:14 GMT</pubDate></item><item><title><![CDATA[Reply to Form2 nur bei aktiver Form1 on Thu, 11 Aug 2005 08:52:02 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>vielleicht hilft es ja, wenn du vor dem Anzeigen des Subforms noch <em>Application-&gt;Active</em> überprüfst.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/849924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849924</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 11 Aug 2005 08:52:02 GMT</pubDate></item><item><title><![CDATA[Reply to Form2 nur bei aktiver Form1 on Thu, 11 Aug 2005 08:57:48 GMT]]></title><description><![CDATA[<p>Klappt super. Danke schön! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/849932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849932</guid><dc:creator><![CDATA[Stevens]]></dc:creator><pubDate>Thu, 11 Aug 2005 08:57:48 GMT</pubDate></item></channel></rss>