Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 04-13-2018, 06:50 AM
rmt rmt is offline
Senior Member
 
Join Date: Jun 2013
Posts: 273
Default Delphi5: How to detect click in Gutter(Left Margin)of TDbgrid

Dear Expert,

I am using TDBGrid in my Delphi5 application. I can detect the OnCellClick and OnDblClick Event. But I want to to detect click in Gutter i.e. when I clicked on Left Margin of the Grid. Kindly suggest.

Thanks in advance.

Regards,
__________________
Rmt
  #2  
Old 04-15-2018, 01:36 AM
rojam rojam is offline
Senior Member
 
Join Date: Jun 2015
Posts: 183
Default

simply use the DBGrid's OnMouseUp (don't use OnMouseDown) to check if the X value of the Mouse Click is within the gutter of the DBGrid.

Code:
procedure TForm1.DBGrid1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if X <= 12 then
    ShowMessage('Clicked')
end;
  #3  
Old 04-15-2018, 04:22 AM
rmt rmt is offline
Senior Member
 
Join Date: Jun 2013
Posts: 273
Default

Dear Rojam,

Thank you so much. Its working as expected.

Regards,
__________________
Rmt
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 10:14 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.