Board index » cppbuilder » 2 Form's with 2 RichEdit's and ONLY 1 PopupMenu (sharing problems...)
Oren (Halvani.de)
![]() CBuilder Developer |
2 Form's with 2 RichEdit's and ONLY 1 PopupMenu (sharing problems...)2004-02-18 07:42:21 AM cppbuilder65 hi dear builders, I got a problem to share a PopupMenu between 2 forms with their own RichEdit (on each form 1 RichEdit) I've tryed to share the PopupMenu with the below code...unsucessfully... All I need, is to share the functionality of the PopupMenu so this: WorkingRichEdit->Text = "test..."; should work for the currently active FormX->RichEditX->Text... thanks for any help on this.. Oren /*******************************************************/ // in..Form1 TForm1 *Form1; TRichEdit* WorkingRichEdit; // global variable to hold the currently RichEdit.. __fastcall TForm1::TForm1(TComponent* Owner):TForm(Owner){} void __fastcall TForm1::cmdSetTextClick(TObject *Sender) // this is the PopupMenu->OnClick() { WorkingRichEdit->Text = "test..."; } void __fastcall TForm1::Button1Click(TObject *Sender) { Form2->Show(); } void __fastcall TForm1::FormShow(TObject *Sender) { WorkingRichEdit = RichEdit_1; } /********************************************************/ // in Form2 TForm2 *Form2; __fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) {} void __fastcall TForm2::FormShow(TObject *Sender) { WorkingRichEdit = RichEdit_2; } |