<?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[Form öffnen und schließen]]></title><description><![CDATA[<p>Hi,</p>
<p>Ich hab mal folgendes getestet. 2 Formulare. Auf Form1 ein Button. Auf Form 2 eine Action. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Unit1.cpp:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
#include &quot;Unit2.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form2-&gt;ShowModal();

}
//---------------------------------------------------------------------------
</code></pre>
<p>Unit2.cpp</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit2.h&quot;
#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Action1Execute(TObject *Sender)
{
        Close();
}
//---------------------------------------------------------------------------

void __fastcall TForm2::FormActivate(TObject *Sender)
{
        Action1Execute(Form2);
}
//---------------------------------------------------------------------------
</code></pre>
<p>Wenn ich jetzt den Button betätige sollte sich doch eigenlich das Fenster (Form2) öffnen und dann wieder schießen, seh ich das richtig? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
Das Fenster öffnet sich aber es schließt sich nicht mehr. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Hat da jemand ne erklärung dafür? und ne lösung damit sich das fenster wieder automatisch schließt?</p>
<p>Danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149608/form-öffnen-und-schließen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 08 Aug 2026 07:36:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149608.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Jun 2006 17:33:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 17:33:19 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Ich hab mal folgendes getestet. 2 Formulare. Auf Form1 ein Button. Auf Form 2 eine Action. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Unit1.cpp:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
#include &quot;Unit2.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form2-&gt;ShowModal();

}
//---------------------------------------------------------------------------
</code></pre>
<p>Unit2.cpp</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit2.h&quot;
#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Action1Execute(TObject *Sender)
{
        Close();
}
//---------------------------------------------------------------------------

void __fastcall TForm2::FormActivate(TObject *Sender)
{
        Action1Execute(Form2);
}
//---------------------------------------------------------------------------
</code></pre>
<p>Wenn ich jetzt den Button betätige sollte sich doch eigenlich das Fenster (Form2) öffnen und dann wieder schießen, seh ich das richtig? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
Das Fenster öffnet sich aber es schließt sich nicht mehr. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Hat da jemand ne erklärung dafür? und ne lösung damit sich das fenster wieder automatisch schließt?</p>
<p>Danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073340</guid><dc:creator><![CDATA[Verstehichnicht]]></dc:creator><pubDate>Wed, 07 Jun 2006 17:33:19 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 17:43:45 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Höchstrwahrscheinlioch weil während des Activate-Events der Close-Aufruf noch ignoriert wird.</p>
<p>Ich sehe zwar irgendwie keinen Sinn in dem ganzen, aber das einfachste ist doch</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Form2-&gt;Show();
  Form2-&gt;Close();
}
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073347</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 07 Jun 2006 17:43:45 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 17:46:55 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ich weiß zwar nicht was du damit bezwecken willst.</p>
<pre><code>void __fastcall TForm2::FormActivate(TObject *Sender)
{
        Action1Execute(Sender);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1073348</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073348</guid><dc:creator><![CDATA[Avalon]]></dc:creator><pubDate>Wed, 07 Jun 2006 17:46:55 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 17:48:45 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>@ Avalon : Und was soll das bringen?</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073350</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073350</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 07 Jun 2006 17:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 17:54:12 GMT]]></title><description><![CDATA[<p>@ akrai,</p>
<p>hatte ihn so verstanden das er die obere funktion aufrufen wollte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073354</guid><dc:creator><![CDATA[Avalon]]></dc:creator><pubDate>Wed, 07 Jun 2006 17:54:12 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 17:58:12 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>@ Avalon das schafft er auch mit dem Form2 als Parameter. Denn Form2 ist von TObject abgeleitet.</p>
<p>Das Problem vom ist auch nicht ein Compile-Problem, sondern ein logisches problem. Lies dir die Frage noch mal in Ruhe durch.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073356</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 07 Jun 2006 17:58:12 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 18:04:56 GMT]]></title><description><![CDATA[<p>akari schrieb:</p>
<blockquote>
<p>Hallo</p>
<p>@ Avalon das schafft er auch mit dem Form2 als Parameter. Denn Form2 ist von TObject abgeleitet.</p>
<p>Das Problem vom ist auch nicht ein Compile-Problem, sondern ein logisches problem. Lies dir die Frage noch mal in Ruhe durch.</p>
<p>bis bald<br />
akari</p>
</blockquote>
<p>ups, man sollte nicht zuviele sachen zeitgleich machen. hast recht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073362</guid><dc:creator><![CDATA[Avalon]]></dc:creator><pubDate>Wed, 07 Jun 2006 18:04:56 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 18:05:38 GMT]]></title><description><![CDATA[<p>mach doch:<br />
1. mit Timer, der in OnActivate der Forn gestartet wird</p>
<p>2. Schick ne PostMessage (oder wars PostQuitMessage) mit WM_QUIT oder s.ä. an eigene Form (Form 2)<br />
Wichtig: nicht SendMessage</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073363</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073363</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Wed, 07 Jun 2006 18:05:38 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 18:12:58 GMT]]></title><description><![CDATA[<p>Also ich will damit bezwecken das ich wenn die einstellungen in Form 1 auf Manuel stehen, das sich Form2 öffnet und man kann da die daten ändern. und wenn die einstellungen auf automatik stehen dann sollen bestimmte aktionen aus fenster 2 ausgeführt werden und danach das fenster wieder geschlossen werden.</p>
<p>Das alles genau zu erklären was ich da vor hab würde zu lange dauern. Vom prinzip her ist es das was ich vorhab.</p>
<p>Also das mit Form2-&gt;Show(); funzt net da kommt dann immer ne meldung das ich visible und hide nicht benutzen kann.</p>
<p>Und wenn ich Form2-&gt;ShowModal; Form2-&gt;Close(); mache, dann schießt er es immer noch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073371</guid><dc:creator><![CDATA[Verstehichnicht]]></dc:creator><pubDate>Wed, 07 Jun 2006 18:12:58 GMT</pubDate></item><item><title><![CDATA[Reply to Form öffnen und schließen on Wed, 07 Jun 2006 18:17:46 GMT]]></title><description><![CDATA[<p>Hat sich erledigt.</p>
<p>Ich brauch dafür Form2 gar nicht zu öffnen. Ich kann die Aktionen auch von form1 aus ausführen (ohne Form2-&gt;Show() ) und es funzt so wie ich mir das vorgestellt habe.</p>
<p>Aber merkwürdig find ich das schon das er das fenster nicht schließt..</p>
<p>Danke für eure Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073373</guid><dc:creator><![CDATA[Verstehichnicht]]></dc:creator><pubDate>Wed, 07 Jun 2006 18:17:46 GMT</pubDate></item></channel></rss>