C
C.g.Lee
Unregistered / Unconfirmed
GUEST, unregistred user!
Grd(Stringgrid)的DefaultDraw:=True;
procedure TForm.GrdDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
Begin
with StringGrd do
begin
if (ARow Mod 2=1)and(ACol<>0) then
begin
Canvas.Brush.Color :=clInfoBk;
Canvas.FillRect(Rect);
Canvas.Font.Name:='Tahoma';
end;
Canvas.TextOut(Rect.Left + 2, Rect.Top + 2, Cells[ACol,ARow]);
end;
end;
初始化状态 Grd1.Cells[1,1]:='';
Grd1.Cells[1,1]:='xx';
它不能使Cells[1,1]立即显示为xx,但在StringGrd.Cells[1,1]位置CLick
Cells[1,1]显示出'XX'
问题出在哪里,该如何解决!谢谢!
procedure TForm.GrdDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
Begin
with StringGrd do
begin
if (ARow Mod 2=1)and(ACol<>0) then
begin
Canvas.Brush.Color :=clInfoBk;
Canvas.FillRect(Rect);
Canvas.Font.Name:='Tahoma';
end;
Canvas.TextOut(Rect.Left + 2, Rect.Top + 2, Cells[ACol,ARow]);
end;
end;
初始化状态 Grd1.Cells[1,1]:='';
Grd1.Cells[1,1]:='xx';
它不能使Cells[1,1]立即显示为xx,但在StringGrd.Cells[1,1]位置CLick
Cells[1,1]显示出'XX'
问题出在哪里,该如何解决!谢谢!