procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
if (gdfocused in state) then
begin
DBCombobox1.Left := Rect.Left + DBGrid1.Left;
checkbox1.Top := Rect.Top + DBGrid1.top;
checkbox1.Width := Rect.Right - Rect.Left;
checkbox1.Height := Rect.Bottom - Rect.Top;
checkbox1.Visible := True;
end;
end;
你可同时加入各种vcl控件,只要在form上放置你想要假如gride的控件即可(如dbcombobox)
Field: TField; State: TGridDrawState);
begin
if (gdfocused in state) then
begin
DBCombobox1.Left := Rect.Left + DBGrid1.Left;
checkbox1.Top := Rect.Top + DBGrid1.top;
checkbox1.Width := Rect.Right - Rect.Left;
checkbox1.Height := Rect.Bottom - Rect.Top;
checkbox1.Visible := True;
end;
end;
你可同时加入各种vcl控件,只要在form上放置你想要假如gride的控件即可(如dbcombobox)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货