Kill focus rectangle on RadioButton

Posted on 2005-04-07
Last Modified: 2010-04-05
Exactly what I say in the title. I don't wish to show a dotted rectangle on RadioButton caption. How to stop it ?
Question by:ginsonic
    LVL 15

    Expert Comment

    How about setting the focus to another component on the form


    If you select a radio button manually, you will see the rectangle as you change focus
    LVL 11

    Expert Comment

    MikeLittleWood meant something like this

    procedure TForm1.RadioButton1Enter(Sender: TObject);
    RadioButton1.Checked:=not RadioButton1.Checked;
    LVL 26

    Accepted Solution

    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
    LVL 26

    Expert Comment

    I meant remove the radiobutton's caption, not the label's, if you were confused.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now