StringGrid的Click事件中获取选中的当前行

来源:互联网 发布:穿越火线mac-10 编辑:程序博客网 时间:2024/05/22 18:47

StringGrid 的option中的goRangeSelect设置为false

确保goRowSelect为true;

然后

procedure TfrmEvent.StringGrid1Click(Sender: TObject);
begin
   doEveID.Text:=StringGrid1.Cells[0,StringGrid1.selection.bottom];
   doID.Text := StringGrid1.Cells[1,StringGrid1.selection.bottom];
  end; 

原创粉丝点击