Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Grid Double Click

Status
Not open for further replies.

Semose

Programmer
Sep 23, 2003
4
CA
Could anyone tell me how to know what cell I'm double clicking? I want to execute a file using what is in the cell.
 
The member variables row and col tell you what cell you have (double) clicked.

For example:
Code:
procedure TForm1.Grid1DblClick(Sender: TObject);
begin
 ShowMessageFmt ( 'You clicked col %d and row %d', [ Grid1.Col, Grid1.Row ] );
end;

Andrew
 
You can use the

StringGrid.Cells[Column, Row] to get the information in the cell if that's what you need.

Leslie
 
Thanks! I used this already in a Tic-Tac-Toe program I made a while back, I was just using it in the wrong spot hehe
 
Leslie, to be pedantic (and the compiler usually is) the property indicating which column has been clicked is 'Col' not 'Column'. 'Row' is correct.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top