H halen Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #1 请问:如何让每条记录的各字段值显示在DBGrid的单元格中心?
P peleg Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #2 alignment为taCenter(table里面每个字段)
H HeBaisong Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #3 DBGrid连接的数据集设置为静态字段,然后设置他们的对齐方式居中就可以了!
D delphiland Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #4 procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin DBgrid1.Canvas.FillRect(Rect); 计算字符高度、宽度, 再计算要输出的Left , Top DBGrid1.Canvas.TextOut(...) end;
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin DBgrid1.Canvas.FillRect(Rect); 计算字符高度、宽度, 再计算要输出的Left , Top DBGrid1.Canvas.TextOut(...) end;
J jsxjd Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #5 在 DbGrid 相应数据集控件的 AfterOpen 事件中进行事件!! procedure TForm1.ADOTable1AfterOpen(DataSet: TDataSet); var i:integer; begin for i:=0 to adotable1.FieldCount -1 do adotable1.Fields.Alignment:=taCenter; end;
在 DbGrid 相应数据集控件的 AfterOpen 事件中进行事件!! procedure TForm1.ADOTable1AfterOpen(DataSet: TDataSet); var i:integer; begin for i:=0 to adotable1.FieldCount -1 do adotable1.Fields.Alignment:=taCenter; end;
S SPYSKY Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #6 設置DBGird的Colunms---------alignment为taCenter(table里面每个字段)
H halen Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-25 #7 to jsxid: 我在C++ Builder中写这段程序发现,adotable->fields无Alignmeng属性,在 C++ Builder中应该如何用呢?