|
|
2006/3/27 下午 07:28:07
好像不可以 AnsiString a = "abc"; AnsiString b = "this is roger"; AnsiString e = "abc"; int change = 0; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::FormShow(TObject *Sender) { Edit1->Text = a; Edit2->Text = b; Edit3->Text = e; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { Form2->Show(); } //--------------------------------------------------------------------------- void __fastcall TForm1::Timer1Timer(TObject *Sender) { int i = Form2->getchange(); if(i == 1){ Timer1->Enabled = false; Edit1->Text = Form2->getc(); Edit2->Text = Form2->getd(); }//end i } TForm2 *Form2; extern AnsiString a,b,e; extern int change; AnsiString c,d,f;
int schange; //--------------------------------------------------------------------------- __fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- int TForm2::getchange(){ return change; }
AnsiString TForm2::getc(){ c = Edit1->Text; return c; }
AnsiString TForm2::getd(){ d = Edit2->Text; return d; }
void __fastcall TForm2::FormShow(TObject *Sender) { Edit1->Text = a; Edit2->Text = b; Edit3->Text = e; } //---------------------------------------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender) { getchange(); change = 1; getc(); getd(); Form1->Edit3->Text = e; Form2->Visible = false; }
|
|