Board index » delphi » TEdit : Change font color when disabled

TEdit : Change font color when disabled

Hello,

I need to set the font color to black on an disabled editbox.

---------------------------------------------------
Mikael Rajam?ki
Systemdeveloper, Consilia Solutions AB
Email : mik...@consilia.aland.fi
Http : www.consilia.aland.fi

 

Re:TEdit : Change font color when disabled


Quote
Mikael Rajam?ki wrote:

> I need to set the font color to black on an disabled editbox.

How about not using Disable to lock that Edit1, but code something
like this:

var
 Disabled:Boolean;
...

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Disabled
  then Key:=#0;
end;

Re:TEdit : Change font color when disabled


Instead of disabling the TEdit, you can set the ReadOnly property to True.

Mikael Rajam?ki <mik...@consilia.aland.fi> skrev i en
nyhedsmeddelelse:80r599$t...@gandalf.alcom.aland.fi...

Quote
> Hello,

> I need to set the font color to black on an disabled editbox.

Re:TEdit : Change font color when disabled


On Tue, 16 Nov 1999 17:38:10 +0100 Finn Tolderlund wrote:

Quote
> Instead of disabling the TEdit, you can set the ReadOnly property to True.

...which would still make the edit's text selectable.

Better place the TEdit on a TPanel and disable the panel instead. That
disables all components located on the panel, but doesn't set the
contained components disabled (keeps the black font color).

Udo

Re:TEdit : Change font color when disabled


Udo Nesshoever <nesshoe...@gmx.net> skrev i en
nyhedsmeddelelse:rZgyOJsH3afAUxT8q8Q4JBeUi...@4ax.com...

Quote
> On Tue, 16 Nov 1999 17:38:10 +0100 Finn Tolderlund wrote:

> > Instead of disabling the TEdit, you can set the ReadOnly property to
True.

> ...which would still make the edit's text selectable.

Not if you set the TabStop property to False.
A Good Thing (tm) is that it enables the user to use the mouse to select the
text and copy the text to the clipboard.

Finn Tolderlund

Re:TEdit : Change font color when disabled


On Wed, 17 Nov 1999 20:30:18 +0100 Finn Tolderlund wrote:

Quote

> Udo Nesshoever <nesshoe...@gmx.net> skrev i en
> nyhedsmeddelelse:rZgyOJsH3afAUxT8q8Q4JBeUi...@4ax.com...
> > On Tue, 16 Nov 1999 17:38:10 +0100 Finn Tolderlund wrote:

> > > Instead of disabling the TEdit, you can set the ReadOnly property to
> True.

> > ...which would still make the edit's text selectable.

> Not if you set the TabStop property to False.
> A Good Thing (tm) is that it enables the user to use the mouse to select the
> text and copy the text to the clipboard.

Sure. Depending on what the user wants and the programmer thinks. But
I would call that simply readonly. If I talk about disabled then I
mean DISABLED.

Udo

Re:TEdit : Change font color when disabled


Udo Nesshoever <nesshoe...@gmx.net> skrev i en
nyhedsmeddelelse:qyQ1OMt7oMVxH0EUJ7w8I6or4...@4ax.com...

Quote
> Sure. Depending on what the user wants and the programmer thinks. But
> I would call that simply readonly. If I talk about disabled then I
> mean DISABLED.

????

Other Threads