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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force a mouse-click on grid's column

Status
Not open for further replies.

koklimabc

Programmer
Jun 17, 2013
49
MY
Hi all,

I need some help on how to force a left-mouse click to column1 after insert a newlines in grid.
All step is done by auto not manual.
setfocus() function could only stands on top of column1 but still unable click inside the text.
I've tried to use keyboard '{LEFTMOUSE}' but still not working in VFP 6.0. I realised "Mouse Click At"
should be worked fined to auto-click anyplace inside the form but i don't know bound it into controls.

Code :

sele tmpcur_
go bottom
append blank

thisform.grid_list.columns(1).text1.setfocus()
thisform.grid_list.columns(1).text1.click -----> How to made it works.

Appreciate Thanksful to someone could help.
 
>thisform.grid_list.columns(1).text1.click -----> How to made it works.
I assumed you tried and this doesn't work. Easy to understand: The click event in VFP is not the event itself, it's a method triggered by the event, it's not triggering the event.

What does the trick is

[pre]thisform.grid_list.columns(1).text1.Setfocus()
thisform.grid_list.columns(1).text1.SelStart=0[/pre]

And don't ficus the grid first, that'll put two events in the queue and the SelStart will be set too early.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top