"Weiter Button"



  • Hallo

    Bin am verzweifeln. Habe mir Visual C++ 2005 gesaugt und es auch geschafft einen "Beenden Button" zuerstellen. Nur ich verzweifele an dem Weiter utton mit Show::Form2 und danach Hide::Form1 geht nicht.

    Plz help



  • nun auch regestriert bitte um hilfe



  • 1. Falsches Forum
    2. Zeig mal Code



  • Falsches Forum? Ja es ist Visual C++ und nicht C++. Nur ich find das Visual C++ Forum nicht.

    Form1.h Code:

    #pragma once
    
    namespace hase {
    
    	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
    	///
    	/// Warnung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie auch
    	///          die Ressourcendateiname-Eigenschaft für das Tool zur Kompilierung verwalteter 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 ref class Form1 : public System::Windows::Forms::Form
    	{
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    			//
    			//TODO: Konstruktorcode hier hinzufügen.
    			//
    		}
    
    	protected:
    		/// <summary>
    		/// Verwendete Ressourcen bereinigen.
    		/// </summary>
    		~Form1()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
    	private: System::Windows::Forms::Button^  button1;
    	private: System::Windows::Forms::Label^  label1;
    	private: System::Windows::Forms::Label^  label2;
    	private: System::Windows::Forms::PictureBox^  pictureBox1;
    	private: System::Windows::Forms::Button^  button2;
    	protected: 
    
    	private:
    		/// <summary>
    		/// Erforderliche Designervariable.
    		/// </summary>
    		System::ComponentModel::Container ^components;
    
    #pragma region Windows Form Designer generated code
    		/// <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)
    		{
    			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
    			this->button1 = (gcnew System::Windows::Forms::Button());
    			this->label1 = (gcnew System::Windows::Forms::Label());
    			this->label2 = (gcnew System::Windows::Forms::Label());
    			this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
    			this->button2 = (gcnew System::Windows::Forms::Button());
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->BeginInit();
    			this->SuspendLayout();
    			// 
    			// button1
    			// 
    			this->button1->BackColor = System::Drawing::SystemColors::ControlLightLight;
    			this->button1->ForeColor = System::Drawing::Color::DarkBlue;
    			this->button1->Location = System::Drawing::Point(364, 356);
    			this->button1->Name = L"button1";
    			this->button1->Size = System::Drawing::Size(97, 30);
    			this->button1->TabIndex = 0;
    			this->button1->Text = L"Beenden";
    			this->button1->UseVisualStyleBackColor = false;
    			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
    			// 
    			// label1
    			// 
    			this->label1->AutoSize = true;
    			this->label1->BackColor = System::Drawing::SystemColors::ControlText;
    			this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 13));
    			this->label1->ForeColor = System::Drawing::Color::CornflowerBlue;
    			this->label1->Location = System::Drawing::Point(40, 51);
    			this->label1->Name = L"label1";
    			this->label1->Size = System::Drawing::Size(403, 22);
    			this->label1->TabIndex = 1;
    			this->label1->Text = L"Dieser Patch entfernt euch das Intro bei Gothic 1!";
    			// 
    			// label2
    			// 
    			this->label2->AutoSize = true;
    			this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12));
    			this->label2->ForeColor = System::Drawing::Color::Coral;
    			this->label2->Location = System::Drawing::Point(26, 366);
    			this->label2->Name = L"label2";
    			this->label2->Size = System::Drawing::Size(178, 20);
    			this->label2->TabIndex = 2;
    			this->label2->Text = L"Edit by: Der Nette Mann";
    			// 
    			// pictureBox1
    			// 
    			this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox1.Image")));
    			this->pictureBox1->Location = System::Drawing::Point(85, 129);
    			this->pictureBox1->Name = L"pictureBox1";
    			this->pictureBox1->Size = System::Drawing::Size(303, 189);
    			this->pictureBox1->TabIndex = 3;
    			this->pictureBox1->TabStop = false;
    			// 
    			// button2
    			// 
    			this->button2->BackColor = System::Drawing::SystemColors::ControlLightLight;
    			this->button2->ForeColor = System::Drawing::Color::Blue;
    			this->button2->Location = System::Drawing::Point(243, 356);
    			this->button2->Name = L"button2";
    			this->button2->Size = System::Drawing::Size(99, 29);
    			this->button2->TabIndex = 4;
    			this->button2->Text = L"Weiter";
    			this->button2->UseVisualStyleBackColor = false;
    			this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
    			// 
    			// Form1
    			// 
    			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->BackColor = System::Drawing::SystemColors::ControlText;
    			this->ClientSize = System::Drawing::Size(483, 414);
    			this->Controls->Add(this->button2);
    			this->Controls->Add(this->pictureBox1);
    			this->Controls->Add(this->label2);
    			this->Controls->Add(this->label1);
    			this->Controls->Add(this->button1);
    			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
    			this->Name = L"Form1";
    			this->Text = L"Gothic 1 Intro Patch by der Nette Mann";
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->EndInit();
    			this->ResumeLayout(false);
    			this->PerformLayout();
    
    		}
    #pragma endregion
    	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    				 Application::Exit();
    
    			 }
    	private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
    
    			 }
    };
    }
    

    //Edit Code tags hinzugefügt 🙄



  • Naja, das scheint eher C++/CLI zu sein 🙂
    Es gibt übrigens nette Code-Tags, womit der Post gleich viel besser aussieht (kannst ja editieren):

    ...
    

    oder

    ...
    

    Und dann schilder noch mal ein wenig genauer das Problem, hab das irgendwie nich verstanden 😕



  • Dieser Thread wurde von Moderator/in evilissimo aus dem Forum 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.



  • Also:

    Grundidee: Gothic 1 das Intro wegmachen (ich selber zocke es nicht 🙂 Sollte nur ne herausforderung sein )

    Beenden Button (Application::Exit();) stand in der Hilfe 🙂 leider zu 80 % auf Englisch 😞 zum lernen schlecht.

    So nun hab ich einen Button der es Beendet. Nur keinen der mir von Form1.h zu Form2.h wechselt --> Weiter Button

    und der Code davon müsste ja auch irgendwie show::Form1();
    Hide::Form2();
    heißen. Geht aber nicht.

    Das ist mein Problem 🙂

    Vielen Dank für das verschieben und coden thx!

    fals nicht verstanden plz nachfragen



  • weis keiner was ich meine?

    oder wieso antwortet niemand?



  • *nachfrag* Was hat das Intro von Gothic 1 mit deinen beiden Forms zu tun?

    Und im Klartext: Dein Problem ist, dass bei dem Klick auf den "Weiter"-Button die zweite Form nicht angezeigt wird oder wie?
    edit: Wenn ja, dann guck mal hier, ist aus der C++/CLI-FAQ 😉



  • Mit Gothic hat es eig gar nichts zutuen. Sollte nur die Grund Idee zum Problem verbinden das man es besser versteht. Und ja sowas suchte ich nur als ich die Sufu nutzte hatte ich ca 500 Beiträge daher neues Thema

    Sowas suchte ich rall es aber immer noch nicht

    Form2^ XY = gcnew Form2();
    XY->ShowDialog();

    bekomme ich nur errors xy sind umgeändert das include zeug hab ich nun gebacken bekommen nur das andere nicht

    Gibt es denn keine Kack nubbel anleitung für ein Button der Weiter heißt und von Form 1 nach 2 wechselt?

    Vielen Dank und Tschüss!



  • So eine "Kack nubbel anleitung" heißt Tutorial und gibts haufenweise im Internet. Einfach mal die Zeit nehmen und durcharbeiten.

    Ansonsten kann ich dir auch nicht helfen, ich versteh einfach nicht, was du da schreibst 😕



  • Ist das noch aktuell?


Anmelden zum Antworten