StringGrid的Click事件中獲取選中的當前行

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; 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章