Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Position cursor in a EditBox in grid
Message
From
18/04/2019 07:49:13
 
 
To
18/04/2019 06:23:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01668156
Message ID:
01668180
Views:
46
Yes, this is right, it's working with keyboard rightarrow. :)

But I've question: in this solution we are working without .selstart property.
Why when editbox in the grid not working with .selstart property?
I have got correctly .selstart for .editbox (for example 35, I've saw it in debuger) but allways position cursor in editbox is 1!
Why?
Maybe because grid refresh ?

I'll create small example and I'll sent to you during today




If you can create a small example which reproduces the behavior, I can fiddle with it and try to figure it out.

You could always:
FOR lnI = 1 TO this.nLastCursorPosition
    KEYBOARD "{RIGHTARROW}"
 NEXT
:-)

>Hi Rick,
>
>I did as you suggested, and did not work :(
>a cursor is yet in position 1
>
>
>Create a custom class, and on the LostFocus event save the position, and on GotFocus restore it.
>
>You can use SelStart + a keyboard right/left arrow to position it.
>
>Maybe??
>
>>Hi Rick,
>>Thanks for answer
>>
>>Yes, it does, but the problem is when I invoke a another form or for example browse from the grid by right-clicking in the edit box, so I go back to editbox in the grid
>>
>>After returning to the grid, the cursor has position 1 in editbox
>>
>>in the case when editbox is on the form - works correctly, but when editbox is inside a grid - then no
>>
>>>Hi,
>>>
>>>One simple case:
>>>
>>>I have a grid and edibox inside grid. I find myself on the editbox, for example on the 25 position inside the editbox.
>>
>>>I've right click from editbox and for example I've invite the browse or, for example, another form
>>
>>>How to return to position 25 after returning from the browse (or another form) to editbox in grid ?
>>>Please example
>>>
>>>I've tried with selstart, but it's not working
>>>
>>>Thanks
>>
>>I tested this code:
>>
_screen.AddObject("abc", "editbox")
>>_screen.abc.Visible = .t.
>>Here I manually clicked on the editbox and pressed spacebar 25 times. I then ran this by typing in all lines, selecting it, right-click, "Execute selection". It reported 25.
>>
_screen.abc.SetFocus
>>KEYBOARD '{SHIFT+LEFTARROW}'  && Simulate the user typing Shift+Left to begin selecting text
>>? _screen.abc.selStart
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform