Textfield Cursor

BlitzPlus Forums/BlitzPlus Programming/Textfield Cursor

Sky009(Posted 2003) [#1]
Hello!

SETGADGETTEXT textfield, string$

How can i set the position of the cursor at the end of
the string?

Any hints?

Greetings

sky009


Beaker(Posted 2003) [#2]
This should help:

;put these two lines into your user32.decls file
;.lib "user32.dll"
;SendMessage%(hwnd, msg, wParam, mParam):"SendMessageA"

Function SelectText(textgad,start,fin=-1)
	If fin=-1 Then fin = start
	;Local EM_SETSEL=$B1
	sendmessage(QueryObject(textgad,1),$B1,start,fin)
End Function



Sky009(Posted 2003) [#3]
Thanks Masterbreaker!

And know the same without marking the string!


Grettings

sky009


Snarty(Posted 2003) [#4]
SendMessage QueryObject(TextGad,1),$B1,Len(TextFieldText(TextGad)),Len(TextFieldText(TextGad))


Beaker(Posted 2003) [#5]
Just dont use the last parameter of SelectText() and it does it for you.