Board index » delphi » What's the best way to make a readonly checkbox?

What's the best way to make a readonly checkbox?

I want to make checkboxes and radio buttons readonly.  I know I could
disable them but that changes the text color and makes them harder to
read.  I want something like the TEdit readonly property so the text and
background don't change but the user can't modify it.

Thanks, Alan

 

Re:What's the best way to make a readonly checkbox?


In message <38041ECE.97B72...@concentric.net>, A Anderson stated:
Quote
> I want to make checkboxes and radio buttons readonly.  I know I could
> disable them but that changes the text color and makes them harder to
> read.  I want something like the TEdit readonly property so the text and
> background don't change but the user can't modify it.

Alan,

put them on a panel and set the Enabled property of the panel to false.

--
Regards
Ralph (TeamB)
--

Re:What's the best way to make a readonly checkbox?


Quote
A Anderson wrote:

> I want to make checkboxes and radio buttons readonly.  I know I could
> disable them but that changes the text color and makes them harder to
> read.  I want something like the TEdit readonly property so the text and
> background don't change but the user can't modify it.

Just my 2 eurocents...

Don't you think it's bad interface style to let the user
see an edit control (or whatever control that can usually be
interacted with) when this very control is in fact, read-only.

I, for one, would choose another way to inform the user... A label,
for instance.

HTH

Delphi-natively yours,
--
Jean-Francois Nifenecker, Bordeaux (Europe)
jf...@compuserve.com

Re:What's the best way to make a readonly checkbox?


On Tue, 12 Oct 1999 23:55:27 -0600, A Anderson

Quote
<alana...@concentric.net> wrote:
>I want to make checkboxes and radio buttons readonly.  I know I could
>disable them but that changes the text color and makes them harder to
>read.  I want something like the TEdit readonly property so the text and
>background don't change but the user can't modify it.

Derive a new component with overriden Toggle method like

procedure TMyCheckBox.Toggle;
begin
   if not(FReadOnly)then
      case State of
         cbUnchecked: if AllowGrayed then State:=cbGrayed else
State:=cbChecked;
         cbChecked: State:=cbUnchecked;
         cbGrayed : State:=cbChecked;
      end;
end;

HTH
ain

Re:What's the best way to make a readonly checkbox?


Good point.  I'm using the background color of the form to inform the user
when it's read-only or not.  The users had complained about the text on the
radio buttons and combo boxes being hard to read when they were disabled.

Good point though, you definitely need to have some way to inform the user
that it's read-only.

Alan

Quote
Jean-Francois Nifenecker wrote:
> A Anderson wrote:

> > I want to make checkboxes and radio buttons readonly.  I know I could
> > disable them but that changes the text color and makes them harder to
> > read.  I want something like the TEdit readonly property so the text and
> > background don't change but the user can't modify it.

> Just my 2 eurocents...

> Don't you think it's bad interface style to let the user
> see an edit control (or whatever control that can usually be
> interacted with) when this very control is in fact, read-only.

> I, for one, would choose another way to inform the user... A label,
> for instance.

> HTH

> Delphi-natively yours,
> --
> Jean-Francois Nifenecker, Bordeaux (Europe)
> jf...@compuserve.com

Other Threads