胡
胡鸣
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是EhLib 4.2.16,在这个版本中可以通过代码设置DBGridEh的RowCount,也可以在通过代码设置网格线的颜色,代码如下:
procedure TForm.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect;
DataCol: Integer;
Column: TColumnEh;
State: TGridDrawState);
begin
with (Sender as TDBGrideh).Canvasdo
begin
Pen.Color := clred;
MoveTo(Rect.Left, Rect.Bottom);
LineTo(Rect.Right, Rect.Bottom);
MoveTo(Rect.Right, Rect.Top);
LineTo(Rect.Right, Rect.Bottom);
end;
end;
我想派生一个新的DBGridEh控件,新增上面两个属性,在设计时可用,请给一个的代码。
procedure TForm.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect;
DataCol: Integer;
Column: TColumnEh;
State: TGridDrawState);
begin
with (Sender as TDBGrideh).Canvasdo
begin
Pen.Color := clred;
MoveTo(Rect.Left, Rect.Bottom);
LineTo(Rect.Right, Rect.Bottom);
MoveTo(Rect.Right, Rect.Top);
LineTo(Rect.Right, Rect.Bottom);
end;
end;
我想派生一个新的DBGridEh控件,新增上面两个属性,在设计时可用,请给一个的代码。