Replacement for DBMemo.Font.Color / Visual disable Control?
Posted: Wed May 12, 2010 10:05 am
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
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?
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?