neue Form einbinden



  • Hallo
    ich weiß es handelt sich um eine Anfängerfrage, aber genau der bin ich ja auch.
    Wie schaffe ich es bei Visual C++ eigentlich ne Form 2 einzufügen. Also im Projektmappenexplorer seh ich sie schon, kann sie aber nicht aufrufen, da sie vermutlich nicht mit der Form1 verknüpft ist bzw. irgendwo Einträge fehlen. Ich hab allerdings keine Ahnung wo die fehlen, so dass mir das bitte mal jemand beschreibt, was ich noch tun muss, damit ich eine Form2 aufrufen kann.



  • Redest du von Windows Forms?
    Oder von Dialogen/CFormViews?
    😕



  • Ich rede von Windows Forms. Also der Unterlage wo ich die Buttons, Labels und Co reinziehen.



  • Einfach die h-Datei der Form (also z.B. "Form2.h") in der entsprechenden Datei includieren, wo Du den Form verwenden willst (also z.B. "MainForm.h") und dann kannst Du es dort verwenden:

    Form2 ^frm2 = gcnew Form2();
    frm2->ShowDialog(this);
    


  • Macht er leider nicht.
    Er gibt immer die Fehlermeldungen beim Debuggen aus.

    stdafx.cpp
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(318) : error C2065: 'Form2': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(318) : error C2065: 'frm2': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(318) : error C2065: 'gcnew': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(318) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Form2'
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(318) : error C3861: 'Form2': Bezeichner wurde auch mit einer argumentbezogenen Suche nicht gefunden
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(319) : error C2227: Der linke Teil von '->ShowDialog' muss auf Klasse/Struktur/Union zeigen
            Typ ist ''unknown-type''
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(319) : error C3861: 'frm2': Bezeichner wurde auch mit einer argumentbezogenen Suche nicht gefunden
    

    Kann nicht viel mit anfangen. Das mit dem Includieren hab ich auch schon versucht gehabt nur leider funzt das mit dem aufrufen nicht.



  • Du musst in Form1.h gaaaaz oben:

    #include "Form2.h"
    

    reinschreiben!

    @MODs: => C++/CLI



  • Ja hab ich gemacht.



  • Und heist Dein Form nicht "Form2"... sonst würde es gehen...
    Zeig doch mal die Stelle wo Du es einbindest!



  • Also meine Form1.h sieht so aus.

    #include "Form2.h"
    #pragma once
    #include "HotelForm2.h"
    
    class HotelForm2;
    namespace Hotel
    {
    // SNIP...
    
    	public __gc class Form1 : public System::Windows::Forms::Form
    	{	
    // SNIP...
    	private: System::Void button1_Click(System::Object *  sender, System::EventArgs *  e)
    			 {
    				 //this->Show()=Form2;					
    				Form2 ^frm2 = gcnew Form2();
    				frm2->ShowDialog(this); 
    			 }
    
    // SNIP...
    };
    }
    


  • Du solltest es nach

    #pragma once
    

    includieren...



  • Dieser Thread wurde von Moderator/in estartu aus dem Forum MFC (Visual C++) in das Forum C++/CLI mit .NET verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.



  • So hab ich korrigiert.
    Nun steht alles so wie du / sie mir das gesagt haben. Leider funktioniert es immer noch nicht.
    Wo liegt mein Fehler.

    Habe dazu nochmal den Quelltext der Form1.h bis zum Aufruf der Form2.

    #pragma once
    #include "Form2.h"
    
    class Form2;
    namespace Hotel
    {
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    
    	/// <summary> 
    	/// Zusammenfassung für Form1
    	///
    	/// Achtung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie die Eigenschaft
    	///          'Ressourcendateiname' für das Compilertool für verwaltete Ressourcen ändern, 
    	///          das allen .resx-Dateien zugewiesen ist, von denen diese Klasse abhängt. 
    	///          Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
    	///          arbeiten, die diesem Formular zugewiesen sind.
    	/// </summary>
    	public __gc class Form1 : public System::Windows::Forms::Form
    	{	
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    		}
    
    	protected:
    		void Dispose(Boolean disposing)
    		{
    			if (disposing && components)
    			{
    				components->Dispose();
    			}
    			__super::Dispose(disposing);
    		}
    	private: System::Windows::Forms::Button *  button1;
    	private: System::Windows::Forms::Button *  button2;
    	private: System::Windows::Forms::Button *  button3;
    	private: System::Windows::Forms::Button *  button4;
    	private: System::Windows::Forms::Button *  button5;
    	private: System::Windows::Forms::DateTimePicker *  dateTimePicker1;
    
    	private: System::Windows::Forms::Label *  label2;
    	private: System::Windows::Forms::Button *  button6;
    	private: System::Windows::Forms::Panel *  panel1;
    	private: System::Windows::Forms::Label *  label1;
    	private: System::Windows::Forms::MainMenu *  mainMenu1;
    	private: System::Windows::Forms::MenuItem *  menuItem1;
    	private: System::Windows::Forms::MenuItem *  menuItem2;
    	private: System::Windows::Forms::MenuItem *  menuItem3;
    	private: System::Windows::Forms::MenuItem *  menuItem4;
    	private: System::Windows::Forms::MenuItem *  menuItem5;
    	private: System::Windows::Forms::MenuItem *  menuItem6;
    	private: System::Windows::Forms::MenuItem *  menuItem7;
    	private: System::Windows::Forms::MenuItem *  menuItem8;
    	private: System::Windows::Forms::TextBox *  textBox1;
    	private: System::Windows::Forms::TextBox *  textBox2;
    	private: System::Windows::Forms::CheckBox *  checkBox1;
    	private: System::Windows::Forms::TextBox *  textBox3;
    
    	private: System::Windows::Forms::MenuItem *  menuItem9;
    
    	private:
    		/// <summary>
    		/// Erforderliche Designervariable.
    		/// </summary>
    		System::ComponentModel::Container * components;
    
    		/// <summary>
    		/// Erforderliche Methode für die Designerunterstützung. 
    		/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->button1 = new System::Windows::Forms::Button();
    			this->button2 = new System::Windows::Forms::Button();
    			this->button3 = new System::Windows::Forms::Button();
    			this->button4 = new System::Windows::Forms::Button();
    			this->button5 = new System::Windows::Forms::Button();
    			this->dateTimePicker1 = new System::Windows::Forms::DateTimePicker();
    			this->label2 = new System::Windows::Forms::Label();
    			this->button6 = new System::Windows::Forms::Button();
    			this->panel1 = new System::Windows::Forms::Panel();
    			this->textBox3 = new System::Windows::Forms::TextBox();
    			this->checkBox1 = new System::Windows::Forms::CheckBox();
    			this->textBox2 = new System::Windows::Forms::TextBox();
    			this->textBox1 = new System::Windows::Forms::TextBox();
    			this->label1 = new System::Windows::Forms::Label();
    			this->mainMenu1 = new System::Windows::Forms::MainMenu();
    			this->menuItem1 = new System::Windows::Forms::MenuItem();
    			this->menuItem8 = new System::Windows::Forms::MenuItem();
    			this->menuItem9 = new System::Windows::Forms::MenuItem();
    			this->menuItem2 = new System::Windows::Forms::MenuItem();
    			this->menuItem3 = new System::Windows::Forms::MenuItem();
    			this->menuItem4 = new System::Windows::Forms::MenuItem();
    			this->menuItem5 = new System::Windows::Forms::MenuItem();
    			this->menuItem6 = new System::Windows::Forms::MenuItem();
    			this->menuItem7 = new System::Windows::Forms::MenuItem();
    			this->panel1->SuspendLayout();
    			this->SuspendLayout();
    			// 
    			// button1
    			// 
    			this->button1->Location = System::Drawing::Point(24, 40);
    			this->button1->Name = S"button1";
    			this->button1->Size = System::Drawing::Size(88, 23);
    			this->button1->TabIndex = 0;
    			this->button1->Text = S"Nachfrage";
    			this->button1->Click += new System::EventHandler(this, button1_Click);
    			// 
    			// button2
    			// 
    			this->button2->Location = System::Drawing::Point(24, 72);
    			this->button2->Name = S"button2";
    			this->button2->Size = System::Drawing::Size(88, 23);
    			this->button2->TabIndex = 1;
    			this->button2->Text = S"Reservierung";
    			// 
    			// button3
    			// 
    			this->button3->Location = System::Drawing::Point(24, 104);
    			this->button3->Name = S"button3";
    			this->button3->Size = System::Drawing::Size(88, 23);
    			this->button3->TabIndex = 2;
    			this->button3->Text = S"Umsatz";
    			// 
    			// button4
    			// 
    			this->button4->Location = System::Drawing::Point(24, 136);
    			this->button4->Name = S"button4";
    			this->button4->Size = System::Drawing::Size(88, 23);
    			this->button4->TabIndex = 3;
    			this->button4->Text = S"Rechnung";
    			// 
    			// button5
    			// 
    			this->button5->Location = System::Drawing::Point(24, 416);
    			this->button5->Name = S"button5";
    			this->button5->Size = System::Drawing::Size(88, 23);
    			this->button5->TabIndex = 4;
    			this->button5->Text = S"Beenden";
    			this->button5->Click += new System::EventHandler(this, button5_Click);
    			this->button5->Enter += new System::EventHandler(this, button5_Click);
    			// 
    			// dateTimePicker1
    			// 
    			this->dateTimePicker1->Location = System::Drawing::Point(368, 16);
    			this->dateTimePicker1->Name = S"dateTimePicker1";
    			this->dateTimePicker1->TabIndex = 5;
    			// 
    			// label2
    			// 
    			this->label2->AllowDrop = true;
    			this->label2->Font = new System::Drawing::Font(S"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, (System::Byte)0);
    			this->label2->Location = System::Drawing::Point(168, 424);
    			this->label2->Name = S"label2";
    			this->label2->Size = System::Drawing::Size(560, 23);
    			this->label2->TabIndex = 7;
    			this->label2->Text = S"Auslastung";
    			this->label2->Click += new System::EventHandler(this, label2_Click);
    			// 
    			// button6
    			// 
    			this->button6->Location = System::Drawing::Point(24, 168);
    			this->button6->Name = S"button6";
    			this->button6->Size = System::Drawing::Size(88, 23);
    			this->button6->TabIndex = 8;
    			this->button6->Text = S"Auslastung";
    			this->button6->Click += new System::EventHandler(this, button6_Click);
    			// 
    			// panel1
    			// 
    			this->panel1->Controls->Add(this->textBox3);
    			this->panel1->Controls->Add(this->checkBox1);
    			this->panel1->Controls->Add(this->textBox2);
    			this->panel1->Controls->Add(this->textBox1);
    			this->panel1->Controls->Add(this->label1);
    			this->panel1->Controls->Add(this->dateTimePicker1);
    			this->panel1->Location = System::Drawing::Point(144, 8);
    			this->panel1->Name = S"panel1";
    			this->panel1->Size = System::Drawing::Size(584, 360);
    			this->panel1->TabIndex = 9;
    			// 
    			// textBox3
    			// 
    			this->textBox3->Location = System::Drawing::Point(280, 288);
    			this->textBox3->Name = S"textBox3";
    			this->textBox3->TabIndex = 4;
    			this->textBox3->Text = S"Zimmernummer";
    			// 
    			// checkBox1
    			// 
    			this->checkBox1->Location = System::Drawing::Point(56, 328);
    			this->checkBox1->Name = S"checkBox1";
    			this->checkBox1->Size = System::Drawing::Size(112, 24);
    			this->checkBox1->TabIndex = 3;
    			this->checkBox1->Text = S"Kinderzustellbett";
    			// 
    			// textBox2
    			// 
    			this->textBox2->Location = System::Drawing::Point(168, 288);
    			this->textBox2->Name = S"textBox2";
    			this->textBox2->TabIndex = 2;
    			this->textBox2->Text = S"Etage";
    			// 
    			// textBox1
    			// 
    			this->textBox1->Location = System::Drawing::Point(56, 288);
    			this->textBox1->Name = S"textBox1";
    			this->textBox1->TabIndex = 1;
    			this->textBox1->Text = S"Anzahl der Betten";
    			// 
    			// label1
    			// 
    			this->label1->Location = System::Drawing::Point(16, 56);
    			this->label1->Name = S"label1";
    			this->label1->Size = System::Drawing::Size(552, 200);
    			this->label1->TabIndex = 0;
    			// 
    			// mainMenu1
    			// 
    			System::Windows::Forms::MenuItem* __mcTemp__1[] = new System::Windows::Forms::MenuItem*[2];
    			__mcTemp__1[0] = this->menuItem1;
    			__mcTemp__1[1] = this->menuItem2;
    			this->mainMenu1->MenuItems->AddRange(__mcTemp__1);
    			// 
    			// menuItem1
    			// 
    			this->menuItem1->Index = 0;
    			System::Windows::Forms::MenuItem* __mcTemp__2[] = new System::Windows::Forms::MenuItem*[2];
    			__mcTemp__2[0] = this->menuItem8;
    			__mcTemp__2[1] = this->menuItem9;
    			this->menuItem1->MenuItems->AddRange(__mcTemp__2);
    			this->menuItem1->Text = S"Datei";
    			// 
    			// menuItem8
    			// 
    			this->menuItem8->Index = 0;
    			this->menuItem8->Text = S"Beenden";
    			this->menuItem8->Click += new System::EventHandler(this, menuItem8_Click);
    			// 
    			// menuItem9
    			// 
    			this->menuItem9->Index = 1;
    			this->menuItem9->Text = S"Neue Datenbank erstellen";
    			this->menuItem9->Click += new System::EventHandler(this, menuItem9_Click);
    			// 
    			// menuItem2
    			// 
    			this->menuItem2->Index = 1;
    			System::Windows::Forms::MenuItem* __mcTemp__3[] = new System::Windows::Forms::MenuItem*[5];
    			__mcTemp__3[0] = this->menuItem3;
    			__mcTemp__3[1] = this->menuItem4;
    			__mcTemp__3[2] = this->menuItem5;
    			__mcTemp__3[3] = this->menuItem6;
    			__mcTemp__3[4] = this->menuItem7;
    			this->menuItem2->MenuItems->AddRange(__mcTemp__3);
    			this->menuItem2->Text = S"Funktionen";
    			// 
    			// menuItem3
    			// 
    			this->menuItem3->Index = 0;
    			this->menuItem3->Text = S"Nachfrage";
    			// 
    			// menuItem4
    			// 
    			this->menuItem4->Index = 1;
    			this->menuItem4->Text = S"Reservierung";
    			// 
    			// menuItem5
    			// 
    			this->menuItem5->Index = 2;
    			this->menuItem5->Text = S"Umsatz";
    			// 
    			// menuItem6
    			// 
    			this->menuItem6->Index = 3;
    			this->menuItem6->Text = S"Rechnung";
    			// 
    			// menuItem7
    			// 
    			this->menuItem7->Index = 4;
    			this->menuItem7->Text = S"Auslastung";
    			// 
    			// Form1
    			// 
    			this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
    			this->ClientSize = System::Drawing::Size(752, 458);
    			this->Controls->Add(this->panel1);
    			this->Controls->Add(this->button6);
    			this->Controls->Add(this->label2);
    			this->Controls->Add(this->button5);
    			this->Controls->Add(this->button4);
    			this->Controls->Add(this->button3);
    			this->Controls->Add(this->button2);
    			this->Controls->Add(this->button1);
    			this->Menu = this->mainMenu1;
    			this->Name = S"Form1";
    			this->Text = S"Projekt Hotel";
    			this->panel1->ResumeLayout(false);
    			this->ResumeLayout(false);
    
    		}	
    	private: System::Void button5_Click(System::Object *  sender, System::EventArgs *  e)
    			 {
    				 this->Close();
    			 }
    
    	private: System::Void button1_Click(System::Object *  sender, System::EventArgs *  e)
    			 {
    				 //this->Show()=Form2;					
    				Form2 ^frm2= gcnew Form2();
    				frm2->ShowDialog(this); 
    			 }
    


  • Was soll denn das "class Form2;" ganz oben??? Das gehört da nicht hin, da Du ja die h-Datei einbindest und mit dieser Definition noch eine zweite Klasse vom typ "Form2" definierst (die er dann nicht findet).

    Wo liegt denn die "Form2"? Im gleichen Namespace? Oder in einem anderen? Falls in einem anderen, so musst Du den Namespace natürlich mit angeben!



  • Wie meinst du das mit Namespace - kann mir nicht so wirklich vorstellen was du meinst. Wenn du meinst, ob sie im gleichen Ordner leigen dann ja.
    Habe das mit der class Form2 weggenommen, aber es erscheinen folgende Meldungen.

    Kompilieren...
    stdafx.cpp
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C2065: 'Form2': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C2065: 'frm2': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C2065: 'gcnew': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Form2'
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C3861: 'Form2': Bezeichner wurde auch mit einer argumentbezogenen Suche nicht gefunden
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(321) : error C2227: Der linke Teil von '->ShowDialog' muss auf Klasse/Struktur/Union zeigen
            Typ ist ''unknown-type''
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(321) : error C3861: 'frm2': Bezeichner wurde auch mit einer argumentbezogenen Suche nicht gefunden
    
    Das Build-Protokoll wurde unter "file://c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Debug\BuildLog.htm" gespeichert.
    Hotel - 7 Fehler, 0 Warnung(en)
    
    ---------------------- Fertig ----------------------
    
        Erstellen: 0 erfolgreich, 1 fehlgeschlagen, 0 übersprungen
    


  • Mit "namespace" meine ich das:

    namespace Hotel 
    {
      // ...
    }
    

    Wie sieht denn Deine form2.h aus?



  • Du verwendest VS2003 oder?
    Damit dann auch managed C++, Jochens Code zum Erstellen der Form2 ist aber C++/CLi, und damit ne andere Sprache 😉

    Nur mal so als Tipp.



  • Ja ich nutze Microsoft Visual.net 2003.

    Meine Form2.h sieht folgendermaßen aus.

    pragma once
    #include "Form1.h"
    
    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
    
    namespace Hotel
    {
    	/// <summary> 
    	/// Zusammenfassung für Form2
    	///
    	/// Achtung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie die Eigenschaft
    	///          'Ressourcendateiname' für das Compilertool für verwaltete Ressourcen ändern, 
    	///          das allen .resx-Dateien zugewiesen ist, von denen diese Klasse abhängt. 
    	///          Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
    	///          arbeiten, die diesem Formular zugewiesen sind.
    	/// </summary>
    	public __gc class Form2 : public System::Windows::Forms::Form
    	{
    	public: 
    		Form2(void)
    		{
    			InitializeComponent();
    		}
    
    	protected: 
    		void Dispose(Boolean disposing)
    		{
    			if (disposing && components)
    			{
    				components->Dispose();
    			}
    			__super::Dispose(disposing);
    		}
    
    	private:
    		/// <summary>
    		/// Erforderliche Designervariable.
    		/// </summary>
    		System::ComponentModel::Container* components;
    
    		/// <summary>
    		/// Erforderliche Methode für die Designerunterstützung. 
    		/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			// 
    			// Form2
    			// 
    			this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
    			this->ClientSize = System::Drawing::Size(292, 273);
    			this->Name = S"Form2";
    			this->Text = S"Form2";
    			this->Load += new System::EventHandler(this, Form2_Load);
    
    		}		
    	private: System::Void Form2_Load(System::Object *  sender, System::EventArgs *  e)
    			 {
    			 }
    
    	};
    }
    


  • Hier kannst Du oben das "#include "Form1.h" weglassen!
    Und wie Talla sagt, war mein Code für VC2005... sorry... verwende:

    Form2 *frm2 = new Form2();
    frm2->ShowDialog(this);
    


  • Entweder bin ich zu blöd oder es will einfach nicht. Wenn sich hier nichts ändert- kann mir dann vielleicht einer in VS2003 ein Projekt mit zwei Formen und einem Button erstellen, der dann die zweite Form aufruft?

    Meine Fehlermeldungen sind.

    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C2065: 'Form2': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C2065: 'frm2': nichtdeklarierter Bezeichner
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(320) : error C2061: Syntaxfehler: Bezeichner 'Form2'
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(321) : error C2227: Der linke Teil von '->ShowDialog' muss auf Klasse/Struktur/Union zeigen
            Typ ist ''unknown-type''
    c:\Dokumente und Einstellungen\KingKong3\Desktop\ProjektHotelVL\Hotel\Form1.h(321) : error C3861: 'frm2': Bezeichner wurde auch mit einer argumentbezogenen Suche nicht gefunden
    

    Diese Fehler treten bei folgendem Quelltext auf.

    #pragma once
    
    namespace Hotel
    {
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    
    	/// <summary> 
    	/// Zusammenfassung für Form1
    	///
    	/// Achtung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie die Eigenschaft
    	///          'Ressourcendateiname' für das Compilertool für verwaltete Ressourcen ändern, 
    	///          das allen .resx-Dateien zugewiesen ist, von denen diese Klasse abhängt. 
    	///          Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
    	///          arbeiten, die diesem Formular zugewiesen sind.
    	/// </summary>
    	public __gc class Form1 : public System::Windows::Forms::Form
    	{	
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    		}
    
    	protected:
    		void Dispose(Boolean disposing)
    		{
    			if (disposing && components)
    			{
    				components->Dispose();
    			}
    			__super::Dispose(disposing);
    		}
    	private: System::Windows::Forms::Button *  button1;
    	private: System::Windows::Forms::Button *  button2;
    	private: System::Windows::Forms::Button *  button3;
    	private: System::Windows::Forms::Button *  button4;
    	private: System::Windows::Forms::Button *  button5;
    	private: System::Windows::Forms::DateTimePicker *  dateTimePicker1;
    
    	private: System::Windows::Forms::Label *  label2;
    	private: System::Windows::Forms::Button *  button6;
    	private: System::Windows::Forms::Panel *  panel1;
    	private: System::Windows::Forms::Label *  label1;
    	private: System::Windows::Forms::MainMenu *  mainMenu1;
    	private: System::Windows::Forms::MenuItem *  menuItem1;
    	private: System::Windows::Forms::MenuItem *  menuItem2;
    	private: System::Windows::Forms::MenuItem *  menuItem3;
    	private: System::Windows::Forms::MenuItem *  menuItem4;
    	private: System::Windows::Forms::MenuItem *  menuItem5;
    	private: System::Windows::Forms::MenuItem *  menuItem6;
    	private: System::Windows::Forms::MenuItem *  menuItem7;
    	private: System::Windows::Forms::MenuItem *  menuItem8;
    	private: System::Windows::Forms::TextBox *  textBox1;
    	private: System::Windows::Forms::TextBox *  textBox2;
    	private: System::Windows::Forms::CheckBox *  checkBox1;
    	private: System::Windows::Forms::TextBox *  textBox3;
    
    	private: System::Windows::Forms::MenuItem *  menuItem9;
    
    	private:
    		/// <summary>
    		/// Erforderliche Designervariable.
    		/// </summary>
    		System::ComponentModel::Container * components;
    
    		/// <summary>
    		/// Erforderliche Methode für die Designerunterstützung. 
    		/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->button1 = new System::Windows::Forms::Button();
    			this->button2 = new System::Windows::Forms::Button();
    			this->button3 = new System::Windows::Forms::Button();
    			this->button4 = new System::Windows::Forms::Button();
    			this->button5 = new System::Windows::Forms::Button();
    			this->dateTimePicker1 = new System::Windows::Forms::DateTimePicker();
    			this->label2 = new System::Windows::Forms::Label();
    			this->button6 = new System::Windows::Forms::Button();
    			this->panel1 = new System::Windows::Forms::Panel();
    			this->textBox3 = new System::Windows::Forms::TextBox();
    			this->checkBox1 = new System::Windows::Forms::CheckBox();
    			this->textBox2 = new System::Windows::Forms::TextBox();
    			this->textBox1 = new System::Windows::Forms::TextBox();
    			this->label1 = new System::Windows::Forms::Label();
    			this->mainMenu1 = new System::Windows::Forms::MainMenu();
    			this->menuItem1 = new System::Windows::Forms::MenuItem();
    			this->menuItem8 = new System::Windows::Forms::MenuItem();
    			this->menuItem9 = new System::Windows::Forms::MenuItem();
    			this->menuItem2 = new System::Windows::Forms::MenuItem();
    			this->menuItem3 = new System::Windows::Forms::MenuItem();
    			this->menuItem4 = new System::Windows::Forms::MenuItem();
    			this->menuItem5 = new System::Windows::Forms::MenuItem();
    			this->menuItem6 = new System::Windows::Forms::MenuItem();
    			this->menuItem7 = new System::Windows::Forms::MenuItem();
    			this->panel1->SuspendLayout();
    			this->SuspendLayout();
    			// 
    			// button1
    			// 
    			this->button1->Location = System::Drawing::Point(24, 40);
    			this->button1->Name = S"button1";
    			this->button1->Size = System::Drawing::Size(88, 23);
    			this->button1->TabIndex = 0;
    			this->button1->Text = S"Nachfrage";
    			this->button1->Click += new System::EventHandler(this, button1_Click);
    			// 
    			// button2
    			// 
    			this->button2->Location = System::Drawing::Point(24, 72);
    			this->button2->Name = S"button2";
    			this->button2->Size = System::Drawing::Size(88, 23);
    			this->button2->TabIndex = 1;
    			this->button2->Text = S"Reservierung";
    			// 
    			// button3
    			// 
    			this->button3->Location = System::Drawing::Point(24, 104);
    			this->button3->Name = S"button3";
    			this->button3->Size = System::Drawing::Size(88, 23);
    			this->button3->TabIndex = 2;
    			this->button3->Text = S"Umsatz";
    			// 
    			// button4
    			// 
    			this->button4->Location = System::Drawing::Point(24, 136);
    			this->button4->Name = S"button4";
    			this->button4->Size = System::Drawing::Size(88, 23);
    			this->button4->TabIndex = 3;
    			this->button4->Text = S"Rechnung";
    			// 
    			// button5
    			// 
    			this->button5->Location = System::Drawing::Point(24, 416);
    			this->button5->Name = S"button5";
    			this->button5->Size = System::Drawing::Size(88, 23);
    			this->button5->TabIndex = 4;
    			this->button5->Text = S"Beenden";
    			this->button5->Click += new System::EventHandler(this, button5_Click);
    			this->button5->Enter += new System::EventHandler(this, button5_Click);
    			// 
    			// dateTimePicker1
    			// 
    			this->dateTimePicker1->Location = System::Drawing::Point(368, 16);
    			this->dateTimePicker1->Name = S"dateTimePicker1";
    			this->dateTimePicker1->TabIndex = 5;
    			// 
    			// label2
    			// 
    			this->label2->AllowDrop = true;
    			this->label2->Font = new System::Drawing::Font(S"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, (System::Byte)0);
    			this->label2->Location = System::Drawing::Point(168, 424);
    			this->label2->Name = S"label2";
    			this->label2->Size = System::Drawing::Size(560, 23);
    			this->label2->TabIndex = 7;
    			this->label2->Text = S"Auslastung";
    			this->label2->Click += new System::EventHandler(this, label2_Click);
    			// 
    			// button6
    			// 
    			this->button6->Location = System::Drawing::Point(24, 168);
    			this->button6->Name = S"button6";
    			this->button6->Size = System::Drawing::Size(88, 23);
    			this->button6->TabIndex = 8;
    			this->button6->Text = S"Auslastung";
    			this->button6->Click += new System::EventHandler(this, button6_Click);
    			// 
    			// panel1
    			// 
    			this->panel1->Controls->Add(this->textBox3);
    			this->panel1->Controls->Add(this->checkBox1);
    			this->panel1->Controls->Add(this->textBox2);
    			this->panel1->Controls->Add(this->textBox1);
    			this->panel1->Controls->Add(this->label1);
    			this->panel1->Controls->Add(this->dateTimePicker1);
    			this->panel1->Location = System::Drawing::Point(144, 8);
    			this->panel1->Name = S"panel1";
    			this->panel1->Size = System::Drawing::Size(584, 360);
    			this->panel1->TabIndex = 9;
    			// 
    			// textBox3
    			// 
    			this->textBox3->Location = System::Drawing::Point(280, 288);
    			this->textBox3->Name = S"textBox3";
    			this->textBox3->TabIndex = 4;
    			this->textBox3->Text = S"Zimmernummer";
    			// 
    			// checkBox1
    			// 
    			this->checkBox1->Location = System::Drawing::Point(56, 328);
    			this->checkBox1->Name = S"checkBox1";
    			this->checkBox1->Size = System::Drawing::Size(112, 24);
    			this->checkBox1->TabIndex = 3;
    			this->checkBox1->Text = S"Kinderzustellbett";
    			// 
    			// textBox2
    			// 
    			this->textBox2->Location = System::Drawing::Point(168, 288);
    			this->textBox2->Name = S"textBox2";
    			this->textBox2->TabIndex = 2;
    			this->textBox2->Text = S"Etage";
    			// 
    			// textBox1
    			// 
    			this->textBox1->Location = System::Drawing::Point(56, 288);
    			this->textBox1->Name = S"textBox1";
    			this->textBox1->TabIndex = 1;
    			this->textBox1->Text = S"Anzahl der Betten";
    			// 
    			// label1
    			// 
    			this->label1->Location = System::Drawing::Point(16, 56);
    			this->label1->Name = S"label1";
    			this->label1->Size = System::Drawing::Size(552, 200);
    			this->label1->TabIndex = 0;
    			// 
    			// mainMenu1
    			// 
    			System::Windows::Forms::MenuItem* __mcTemp__1[] = new System::Windows::Forms::MenuItem*[2];
    			__mcTemp__1[0] = this->menuItem1;
    			__mcTemp__1[1] = this->menuItem2;
    			this->mainMenu1->MenuItems->AddRange(__mcTemp__1);
    			// 
    			// menuItem1
    			// 
    			this->menuItem1->Index = 0;
    			System::Windows::Forms::MenuItem* __mcTemp__2[] = new System::Windows::Forms::MenuItem*[2];
    			__mcTemp__2[0] = this->menuItem8;
    			__mcTemp__2[1] = this->menuItem9;
    			this->menuItem1->MenuItems->AddRange(__mcTemp__2);
    			this->menuItem1->Text = S"Datei";
    			// 
    			// menuItem8
    			// 
    			this->menuItem8->Index = 0;
    			this->menuItem8->Text = S"Beenden";
    			this->menuItem8->Click += new System::EventHandler(this, menuItem8_Click);
    			// 
    			// menuItem9
    			// 
    			this->menuItem9->Index = 1;
    			this->menuItem9->Text = S"Neue Datenbank erstellen";
    			this->menuItem9->Click += new System::EventHandler(this, menuItem9_Click);
    			// 
    			// menuItem2
    			// 
    			this->menuItem2->Index = 1;
    			System::Windows::Forms::MenuItem* __mcTemp__3[] = new System::Windows::Forms::MenuItem*[5];
    			__mcTemp__3[0] = this->menuItem3;
    			__mcTemp__3[1] = this->menuItem4;
    			__mcTemp__3[2] = this->menuItem5;
    			__mcTemp__3[3] = this->menuItem6;
    			__mcTemp__3[4] = this->menuItem7;
    			this->menuItem2->MenuItems->AddRange(__mcTemp__3);
    			this->menuItem2->Text = S"Funktionen";
    			// 
    			// menuItem3
    			// 
    			this->menuItem3->Index = 0;
    			this->menuItem3->Text = S"Nachfrage";
    			// 
    			// menuItem4
    			// 
    			this->menuItem4->Index = 1;
    			this->menuItem4->Text = S"Reservierung";
    			// 
    			// menuItem5
    			// 
    			this->menuItem5->Index = 2;
    			this->menuItem5->Text = S"Umsatz";
    			// 
    			// menuItem6
    			// 
    			this->menuItem6->Index = 3;
    			this->menuItem6->Text = S"Rechnung";
    			// 
    			// menuItem7
    			// 
    			this->menuItem7->Index = 4;
    			this->menuItem7->Text = S"Auslastung";
    			// 
    			// Form1
    			// 
    			this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
    			this->ClientSize = System::Drawing::Size(752, 458);
    			this->Controls->Add(this->panel1);
    			this->Controls->Add(this->button6);
    			this->Controls->Add(this->label2);
    			this->Controls->Add(this->button5);
    			this->Controls->Add(this->button4);
    			this->Controls->Add(this->button3);
    			this->Controls->Add(this->button2);
    			this->Controls->Add(this->button1);
    			this->Menu = this->mainMenu1;
    			this->Name = S"Form1";
    			this->Text = S"Projekt Hotel";
    			this->panel1->ResumeLayout(false);
    			this->ResumeLayout(false);
    
    		}	
    	private: System::Void button5_Click(System::Object *  sender, System::EventArgs *  e)
    			 {
    				 this->Close();
    			 }
    
    	private: System::Void button1_Click(System::Object *  sender, System::EventArgs *  e)
    			 {
    				 //this->Show()=Form2;					
    				Form2 *frm2 = new Form2(); 
    				frm2->ShowDialog(this); 
    			 }
    
    	private: System::Void label2_Click(System::Object *  sender, System::EventArgs *  e)
    		 {
    			 label2->Text = ("Hallo Du");
    		 }
    
    	private: System::Void menuItem8_Click(System::Object *  sender, System::EventArgs *  e)
    		 {	
    
    			this->Close();
    		 }
    
    	private: System::Void menuItem9_Click(System::Object *  sender, System::EventArgs *  e)
    		 {
    
    		 }
    
    	private: System::Void button6_Click(System::Object *  sender, System::EventArgs *  e)
    		 {
    
    		 }
    
    };
    }
    

Anmelden zum Antworten