Ali,
>This problem disappeared when I cleared the content of ControlSource (which was a memo field).
There has to be some other code somewhere that's causing the ill-behavior. I just did this from the command window
create cursor x1 ( m1 m )
append blank
replace m1 with "this is a test of a memo content insert into an editbox"
_screen.AddObject( "edt", "editbox" )
_screen.edt.ControlSource = "x1.m1"
_screen.edt.Height = 200
_screen.edt.Width = 200
_screen.edt.Visible = .t.
I clicked into the edt right in front of the word "of" and clicked back to the command window
_screen.edt.SelText = " insert this text right here "
_screen.edt.SetFocus()
This is the current content of the control:
this is a test insert this text right here of a memo content insert into an editbox
with the insertion point right at the end of the inserted text. So are you sure you don't have any code in in the editbox or one of it's parent classes that is preventing you from seeing the same result?