1 2 //--------------------------------------------------------------------------- 3 4 #include <vcl.h> 5 #pragma hdrstop 6 7 #include "Unit1.h" 8 //--------------------------------------------------------------------------- 9 #pragma package(smart_init) 10 #pragma resource "*.dfm" 11 TForm1 *Form1; 12 //--------------------------------------------------------------------------- 13 __fastcall TForm1::TForm1(TComponent* Owner) 14 : TForm(Owner) 15 { 16 } 17 //--------------------------------------------------------------------------- 18 void __fastcall TForm1::RadioGroup1Click(TObject *Sender) 19 { 20 ShowMessage("Bingo"); 21 } 22 //--------------------------------------------------------------------------- 23 void __fastcall TForm1::Button2Click(TObject *Sender) 24 { 25 TNotifyEvent ev; //variable to hold an event 26 ev = RadioGroup1->OnClick; //assign the event 27 RadioGroup1->OnClick = NULL; //set it to null so it wont execute 28 RadioGroup1->ItemIndex = 1; 29 RadioGroup1->OnClick = ev; //set back the orginal event 30 } 31 //--------------------------------------------------------------------------- 32