There is a radiogroup. I tried to make TabStop := false , but it does not help on this element, but it works on the rest, that is, by pressing the tab button, it still focuses on RadioGroup1.

    1 answer 1

    The RadioGroup.TabStop property refers to the radio group itself, but not to the buttons that are located on it. But the buttons have an interesting behavior: each button has its TabStop property, which changes automatically . The logic of this change is that if the button is checked (a dot is present), then this button has the TabStop property set to True , and all other buttons in this group are reset to False .

    To change this automatic behavior, you need to OnClick in the OnClick , in the OnClick event of the radio group, manually reset the TabStop property for all buttons:

     procedure TForm1.rg1Click(Sender: TObject); var I: Integer; begin for I := 0 to rg1.Items.Count - 1 do begin rg1.Buttons[I].TabStop := False; end; end; 

    If when creating a form you have some button marked by default, such a reset should be done in OnShow this form. Therefore, so that the code is not duplicated, it is better to put it into a separate method, like ResetTabStop and pull it from RadioGroup.OnClick and Form.OnShow .