Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread TGrid.OnMouseDown
Tue, Apr 25 2017 2:55 PMPermanent Link

thomh

Hi,

Is there a way to use the X,Y coordinates in a TGrid.OnMouseDown event to know in which column you clicked?

I would like to have a ctIcon column in a Grid which, when clicked, will delete the current row.

I tried to read the TGrid.ColumnIndex in the MouseDown event but it shows the last column you were in.

Thanks.

// Thom
Thu, Apr 27 2017 9:49 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Thom,

<< Is there a way to use the X,Y coordinates in a TGrid.OnMouseDown event to know in which column you clicked?

I would like to have a ctIcon column in a Grid which, when clicked, will delete the current row. >>

Is there any reason that the TGrid.OnClick event can't be used ?  In the OnClick, you will get the proper row/column index, as well as know that the user both pressed and released the mouse.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Apr 27 2017 3:25 PMPermanent Link

thomh

Thanks, Tim. TGrid.OnClick will do nicely.

// Thom
Image