procedure TForm1.DBGrid1EditButtonClick(Sender: TObject); begin Showmessage(DBGrid1.SelectedField.AsString); end; procedure TForm1.FormCreate(Sender: TObject); begin DBGrid1.DataSource:=DataSource1; DataSource1.DataSet:=ADOQuery1; ADOQuery1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;'+ 'Data Source=f:\mcmygs.mdb;'+ 'Persist Security Info=False;'+ 'Jet OLEDB:Database Password=123456'; ADOQuery1.SQL.Text:='Select 自编号,合同号,币种,金额,银行 from dzb'; ADOQuery1.Open; //TColumnButtonStyle = (cbsAuto, cbsEllipsis, cbsNone); DBGrid1.Columns[1].ButtonStyle:=cbsEllipsis; end;
本文来自博客园,作者:del88,转载请注明原文链接:https://www.cnblogs.com/del88/archive/2013/03/28/2987359.html