Here is something that seems so wrong, I must be overlooking something. My radio buttons work as expected when I click on the buttons to change a global variable. But when the variable is set by code elsewhere, the radio group does not reflect the new value when the form is opened. Here is a simple example. TestRadio is a global word set to 0 or 1. There is one control in FormTestRadio, RadioGroup1 with Items "zero" and "one". Default index is -1. TestRadio is initially 0. On first open of the form, the item shows "zero" correctly. TestRadio is then set by code to 1 in another unit. When the form is opened again, the item is still "zero" and after closing, TestRadio has been reset to 0. So the procedure FormShow appears to not be effective after the first open of the form.
var
FormTestRadio: TFormTestRadio;
implementation
procedure TFormTestRadio.FormShow(Sender: TObject);
begin
RadioGroup1.ItemIndex := TestRadio;
end;
procedure TFormTestRadio.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
TestRadio := RadioGroup1.ItemIndex;
end;
When TestRadio is initially 1, at first "one" shows correctly. As before, any further changes outside the form are not picked up.
Using Lazarus 9.30 in WindowsXP.