Kill focus rectangle on RadioButton

Exactly what I say in the title. I don't wish to show a dotted rectangle on RadioButton caption. How to stop it ?
LVL 9
ginsonicAsked:
Who is Participating?
 
Eddie ShipmanAll-around developerCommented:
Well, Since you can not do it without writing an OwnerDrawn button and setting
it's itemState to ODS_NOFOCUSRECT, I'd suggest just placing a label next to it
and remove the caption. You can set the Label's FocusControl property to the
RadioButton and any accelerator's will work correctly, yet you won't get a focus
rectangle.
0
 
mikelittlewoodCommented:
How about setting the focus to another component on the form

SomeComponent.SetFocus;

If you select a radio button manually, you will see the rectangle as you change focus
0
 
calinutzCommented:
MikeLittleWood meant something like this

procedure TForm1.RadioButton1Enter(Sender: TObject);
begin
RadioButton1.Checked:=not RadioButton1.Checked;
Button1.SetFocus;
end;
0
 
Eddie ShipmanAll-around developerCommented:
I meant remove the radiobutton's caption, not the label's, if you were confused.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.