Komme nicht weiter weiss nich wo sich die Form5 klasse befindet

molchedes

Mitglied
hallo ich habe hier ein C++ programm erstell es funktioniert auch aber das problem ist wen ich es in einer anderen funktion öfnen will erkennt er dies nicht.
Mein Programm sieht so aus:


Code:
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::IO;
using namespace System::Windows::Forms;
using namespace System::Drawing;

ref class TR : public Form
{

public: TR()
	{
		Lade1();
	}
public :
			
			void Lade1()
			{
			this->Text = "HÄ?";
			this->Size = Drawing::Size(200,200);
			Label ^label1 = gcnew Label();
			this->Controls->Add(label1);
			label1->Text = "hello world";
			label1->Location = Point(100,50);
			Button ^buton1 = gcnew Button();
			this->Controls->Add(buton1);
			buton1->Text = "OK";
			buton1->Location = Drawing::Point(50,50);
			buton1->Size = Drawing::Size(50,50);
			buton1->Click += gcnew ::EventHandler(this, &::TR::clickevent);
			}

private: System::Void clickevent(System::Object^  sender, System::EventArgs^  e){
			Form ^Form5 = gcnew Form();
			Form5->Text = "Formular";
			Form5->Name = "Foor";
			Form5->Size = Drawing::Size(300,300);
			Button ^knopf = gcnew Button();
			Form5->Controls->Add(knopf);
			knopf->Size = Drawing::Size(50,50);
			knopf->Location = Drawing::Point(140,140);
			knopf->Text = "OKEY";
			knopf->Click += gcnew ::EventHandler(this, &::TR::knopfclick);
			Form5->Show();
			
		 }

private: System::Void knopfclick(System::Object^  sender, System::EventArgs^  e){
                           // schliesse Form5 (nur Form5 wen ich "Close()" reinschreibe 
                           //schliesst er die anwendung ganz.
		 }
};
int main (void)
{
	Application::Run(gcnew TR());
return 0;
}

ich weiss nicht was daran falsch ist währe froh wen ich einen tipp , lösung oder erklärung bekommen würde.
Danke.

P.S ich habe ein Buch auch gekauft steht nix aber da was ich brauche aber sehr hilfreich.
Code:
P.S.S kleine frage am rande wie mache ich dieses graue Fenster hier grösser
 Danke
 
Zurück