TTyDBGrid = class(TCustomGrid)
private
FCurrencyStyle: TTyCurrencyStyle;
...
constructor TCustomDBGridEh.Create(AOwner: TComponent);
begin
...
FCurrencyStyle := TTyCurrencyStyle.Create(Self);
end;
procedure TTyDBGrid.DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);
begin
...
if DrawColumn.GetColumnType = ctCurrency then //判断是否特定类型
begin
FillRect(ARect);
FCurrencyStyle.Left := ARect.Left + Left + 2;
FCurrencyStyle.Top := ARect.Top + top + 2;
FCurrencyStyle.Width := ARect.Right - ARect.Left;
FCurrencyStyle.Height := ARect.Bottom - ARect.Top;
FCurrencyStyle.DrawCurrencyFrame(Canvas, ARect, DrawColumn);
end;
...
end;
现在显示是正确了,但如果我要编辑应该在什么地方写代码,
也就是说当Cell的State为gdFocused时,编辑应该在FCurrencyStyle中。
qq:37112072,在线等待中。。。