Board index » delphi » How do I simulate mouse click on TStringGrid?

How do I simulate mouse click on TStringGrid?

Hello

My string grid contains custom record objects that I use to determine
properties of the cell's text. When I click on the cell, various
buttons and menu items are enabled\disabled relative to the info in
the record, and it all works swimmingly.

When I add\change a record programmatically, I first save the existing
selected cell using a TRect variable (RectMany), then reset the focus
on the grid by using sgrM.Selection := RectMany;

Even though I then call sgrMSelectCell (and previously tried the
MouseDown event), it doesn't have the same effect as clicking with the
mouse, that is the disabled buttons aren't enabled until I click with
the mouse.

The Onclick method has no code behind it in this grid, so it is a
waste of time calling it.

Any suggestions on the correct way to simulate the click?

Regards & TIA

 

Re:How do I simulate mouse click on TStringGrid?


Quote
> My string grid contains custom record objects that I use to determine
> properties of the cell's text. When I click on the cell, various
> buttons and menu items are enabled\disabled relative to the info in
> the record, and it all works swimmingly.

What event are you using to do this enabling/disabling?

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:How do I simulate mouse click on TStringGrid?


Peter

False alarm - my code in the SelectCell method was causing the
problem. Thanks for responding anyway.

Regards

Peter Crain

Other Threads