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;
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?