If I understand you correctly, do you programmatically select your radio group to configure the initial state of the form, but do you have additional code in the click handler that you do not want to run?
If this is the case, you may want to remove the code that sets the form state to your own method, and then call it both from the radio click event and from the initialze / show / create file of your form.
Thus, you can use the same code to set the form to the required state from a user click and set it programmatically without requiring the additional logic required when the user interacts with the dialog. Or maybe I completely misunderstood your problem ...
something like that:
// (open preferences)... SetStateOfFormForSelectedGroup(); procedure TdlgPreferences.SetStateOfFormForSelectedGroup() begin //do all setting of form for selected group here. end; procedure TdlgPreferences.rgMyGroupClick(Sender:TObject) begin SetStateOfFormForSelectedGroup(); //do something useful end;
Russell Troywest
source share