Formularübergreifende anweisungen
-
ich habe ein problem mit folgendem Code: (C++)
//--------------------------------------------------------------------------- #include <vcl\vcl.h> #pragma hdrstop #include "pw_frm.h" //--------------------------------------------------------------------------- #pragma resource "*.dfm" TPW_form *PW_form; String User, PW; //--------------------------------------------------------------------------- __fastcall TPW_form::TPW_form(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TPW_form::Edit1Click(TObject *Sender) { if (PW_form->Edit1->Text == "Username") { PW_form->Edit1->PasswordChar = '*'; PW_form->Edit1->Text = ""; } } //--------------------------------------------------------------------------- void __fastcall TPW_form::Edit2Click(TObject *Sender) { if (PW_form->Edit2->Text == "Passwort :") { PW_form->Edit2->PasswordChar = '•'; PW_form->Edit2->Text = ""; } } //--------------------------------------------------------------------------- void __fastcall TPW_form::Button1Click(TObject *Sender) { User = Edit1->Text; PW = Edit1->Text; if (User == "Name" && PW == "Muster") { PW_form->Visible = false; Form1->Visible = true; // "Form1" sei nicht definiert... } } //---------------------------------------------------------------------------
PW_form is die Loginform
Form1 is die andere Form
das is sowas von
-
Versuch mal den Header, "form2.h"(?) in dein PW_form, über include einzubinden.
also so:
#include "form2.h"
-
Arno schrieb:
Versuch mal den Header, "form2.h"(?) in dein PW_form, über include einzubinden.
also so:
#include "form2.h"
Vielen dank