>In your form you have a treeview.
>(UT browser i suppose...)
>In this treeview, the user select one message and click on it.
>(like i do in the upper section of UT)
>When this appen, you need to display the selected message in an editbox (this editbox is named 'message').
>The cursor is not always at the rigth place when this occur.
You're ok so far. We can also add that the name of the container is also Message. :) So, from an external point of view it may look like this: ThisForm.Message.Message.Refresh().
>For that reason you need to put some code in the treeview click.
>Nooo...
The code is in the NodeClick(). I have the following:
LPARAMETERS node
Node.Selected=.T.
This.Parent.ShowInfo(Node.Key,Node.Index)
Then, the ShowInfo() method is dealing with various thing. The last 2 lines are:
*This.Message.SelStart=1
This.Message.Refresh()
As you see, I put a comment to avoid the bug.
>This behaviour occurs only when the edit box was previuosly accessed and the cursor was let to the end of the editbox.
Yes.
>In this case you just have to put the code in the right place, on the source of the problem.
>This.SelStart=0 && not 1!
>in the Message.LostFocus()
It's the same thing. The problem is as soon as we do a call to SelStart, the bug is stucked in memory.