Replacement for DBMemo.Font.Color / Visual disable Control?

General TRichView support forum. Please post your questions here
Post Reply
Bjoern
Posts: 21
Joined: Tue May 11, 2010 4:05 pm

Replacement for DBMemo.Font.Color / Visual disable Control?

Post by Bjoern »

I'm using a DBRichViewEdit (as a replacement of a DBMemo) and some DBEdits on a DBCtrlGrid.
In some cases i must show the user that a data-record is disabled, so far i used the OnPaintPanel-Event of the DBCtrlGrid with

Code: Select all

if (MyDBCtrlGrid.DataSource.DataSet.FieldByName('disabled').AsBoolean) then
begin
   MyDBEdit.Enabled:= False;
   MyDBMemo.Enabled:= False;
   MyDBMemo.Font.Color := clGray;
end
else
begin
   MyDBEdit.Enabled:= True;
   MyDBMemo.Enabled:= True;
   MyDBMemo.Font.Color := clBlack;
end;
so both Controls, the DBEdit and the DBMemo shows the user that editing is disabled.

At the DBRichViewEdit there is no .Font and when i loop through the TextStyles and set all Fontcolors for all styles to gray, then the original-color is lost when the data-record is enabled again.

Is there any alternative to make all fonts gray, only viewable at the control, no change in the database?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, no. May be you can assign DBRichViewEdit.Color := clBtnFace instead?
Last edited by Sergey Tkachenko on Wed May 12, 2010 1:08 pm, edited 1 time in total.
Bjoern
Posts: 21
Joined: Tue May 11, 2010 4:05 pm

Post by Bjoern »

I'll try this and to make the DBEdit.Color darker too when disabled.
Maybe something for the next version of TRichViewEdit, a property like .DisabledFontColor?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Will be in the next update
Post Reply