Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SelStart function
Message
From
29/03/2006 12:57:43
 
 
To
29/03/2006 12:48:51
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01097121
Message ID:
01108892
Views:
63
You must have some code somewhere that's resetting the .SelStart property. I've tried in VFP6 and in VFP9 and I can't reproduce what you descrbibe.

If I have a grid and a textbox on a form, I can click in the grid (may or may not make changes to the text field there), then click into the textbox on the form (may or may not make changes there), then click back into the middle of a field on the grid, typing starts exactly where I clicked, it doesn't move to the beginning of the grid field. All of this was with a plain grid and a plain text box, no custom code of any sort.


>If I can I would like to get back on this issue because the users of my app are really complaining. I have done a few more tests and have narrowed down the when part but not the why part.
>
>Form Set up:
>
>main form fields for one record(Inspection Record - Header data)
>grid holds child records(Inspection Items)
>
>grid is located in a pageframe along with a button to add a child record and a button to save a child record.
>
>Form edit behavior:(That works)
>
>Form appears with cursor in first editable field and has focus
>User Clicks in a grid cell, edits the data
>
>Cell Code:
>
>GotFocus
>If ThisForm.currentrecordnumber <> getFAIItemQuery.recseq Then
>If ThisForm.PageFrame1.Page1.Command1.Enabled = .T. And ThisForm.recordcheck = .F. Then
>MessageBox("Did you forget to 'Save Item Data' on the last row you modified?")
>ThisForm.recordcheck = .T.
>EndIf
>
>ThisForm.currentrecordnumber = getFAIItemQuery.recseq
>EndIf
>
>InteractiveChange
>ThisForm.statuschangeid = getFAIItemQuery.inspectid
>ThisForm.PageFrame1.Page1.Command1.Enabled = .T.(Save Button)
>ThisForm.itemupdateflag = .T.
>
>At this time a timer begins to fire, flashing a red container around the save button.
>
>THIS WORKS FINE even with interactiveChange code.
>
>However,
>
>If the user clicks in a grid cell(may or may not do any typing), then into a main form control(say they forgot to fill in a text box), now they click back into the grid cell they left at the end of the string. When a key stoke is made the cursor will jump back to the begining of the string. This will not happen if the user clicks into any other grid cell before they click into the one that had focus or click the cell twice.
>
>If I turn the interactiveChange code off in the cell control this does not happen. But why would it work ok in the first situation.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform