爱
爱上猫的鱼
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
if(gdFocused in State) then
begin
if(Field.FieldName=DBMemo1.DataField) then //需要解释
begin
//需要解释下边四行
DBMemo1.Left:=Rect.Left+DBGrid1.Left;
DBMemo1.Top:=Rect.Top+DBGrid1.Top;
DBMemo1.Width:=Rect.Right-Rect.Left;
DBMemo1.Visible:=True;
end;
if(Field.FieldName=DBComboBox1.DataField) then
begin
DBComboBox1.Left:=Rect.Left+DBGrid1.Left;
DBComboBox1.Top:=Rect.Top+DBGrid1.Top;
DBComboBox1.Width:=Rect.Right-Rect.Left;
DBComboBox1.Visible:=True;
end;
end;
end;
解释一下Field,Rect的意思
Field: TField; State: TGridDrawState);
begin
if(gdFocused in State) then
begin
if(Field.FieldName=DBMemo1.DataField) then //需要解释
begin
//需要解释下边四行
DBMemo1.Left:=Rect.Left+DBGrid1.Left;
DBMemo1.Top:=Rect.Top+DBGrid1.Top;
DBMemo1.Width:=Rect.Right-Rect.Left;
DBMemo1.Visible:=True;
end;
if(Field.FieldName=DBComboBox1.DataField) then
begin
DBComboBox1.Left:=Rect.Left+DBGrid1.Left;
DBComboBox1.Top:=Rect.Top+DBGrid1.Top;
DBComboBox1.Width:=Rect.Right-Rect.Left;
DBComboBox1.Visible:=True;
end;
end;
end;
解释一下Field,Rect的意思