Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus to the visible first column, not the defined 1s
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01154356
Message ID:
01154359
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all
>
>I have a grid within a container. On click of the New button (in the same container) the focus has to set to the first column in the grid. The following code did it work, until I later added a new column to the grid. This technically last column is the visible first column so the code starts to fail.
>
>cmdNew.Click()
>
DODEFAULT()
>
>LOCAL lcCtrl
>
>lcCtrl = THIS.PARENT.grd.Columns[1].CurrentControl
>WAIT WINDOW lcctrl
>
>THIS.PARENT.New()
>THIS.PARENT.grd.COLUMNS[1].&lcCtrl..SETFOCUS()
>
>Please advise.
thisform.LockScreen = .t.
THIS.PARENT.New()
DO WHILE THIS.PARENT.grd.LeftColumn # 1
   THIS.PARENT.grd.DoScroll(4)
ENDIF
THIS.PARENT.grd.COLUMNS(1).SETFOCUS()
thisform.LockScreen = .f.
(not tested at all)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform