Too many OnClick Events from RadioGroup or Buttons
Hello list,
the behaviour of the RadioGroups and RadioButtons drive me crazy.
Whenever I change the index of a RadioGroup with
RadioGroup->ItemIndex = 1;
or the checked Property of a RadioButton with
RadioButton->Checked = true;
The eventmethod OnClick( ) is triggered. But this must not be. The change
was not a user request.
To tried to prevent this behaviour by taking an other way:
The BaseClass TControl provides the Method Perform( ). Which sends
WindowMessages to Controls.
RadioButton1->Perform(BM_SETCHECK,true,0);
RadioButton2->Perform(BM_SETCHECK,false,0);
With this piece of code a RadioButton can be checked without triggering the
event OnClick().
But now a MouseClick on the RadioButton2 does not trigger the OnClick()
Method either.
You first have to click one the already checked Button RadioButton1.
Is this behaviour usefull? Why ist the OnClick() Event triggered when the
was not any CLICK?
The problem is, that I need both ways. The user must be able to Change the
settings and I want to change it
within the code without executing the same routines.
I hope anyone has any suggestions? This little problem keeps me up since two
days.
Greetings
Tim Lapawa
LocalRadioBtn->Perform(BM_SETCHECK,true,0);