Jump to content
Sign in to follow this  
Ármányos Kő

REAL cursor position problem whith GUICtrlSetData

Recommended Posts


I have my own GUI and a multiline edit control. The text permanently gets read to a variable for checking.

$origi = GUICtrlRead(3)

Stepping line-by-line (the user pushing DOWN arrow) and deleting some line (if found in other text file) with

$origi = StringReplace($origi, $origiactive&@CRLF, "",1,1).

Then putting back the rest with

GUICtrlSetData(3, $origi)

Here comes the issue.

After GUICtrlSetData the REAL position of the cursor is at the end of the text. So, when the user pushes DOWN arrow again, it brings up the last line.

I tried to remember the position of the deletion with

$deletestart = StringInStr($origi, $origiactive&@CRLF,1,1)

and then

_GUICtrlEditSetSel (3, $deletestart, $deletestart+1)

but not OK.

I've even put some SEND (Left-Right, DOWN-UP, or characters) after _GUICtrlEditSetSel, but no success.

Do you maybe know some way of setting the cursor in the middle of a text in a way that it really gets there?

I am really struggling with this now. This is in one of my most important function of my program. ANY sophisticated solution would be OK. I can tell you I even tried Mouseclick to click in the text and then move the cursor, but still no success.

Please help!



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...