Sign in to follow this  
Followers 0
qmark

highlighted text in edit control

6 posts in this topic

how is it possible to get a text partially highlighted in an edit control?

Share this post


Link to post
Share on other sites



I'm probbally to stupid or "newpid" because it doesn't work

could your check my code please?

#include <GUIConstants.au3>

$start_char = 1

$end_char = 100

$EM_SETSEL = 0x00B1

GUICreate("Address",600,400) ; will create a dialog box that when displayed is centered

$buttonX = GuiCtrlCreateButton ("save",190,10,80,20)

$buttonH = GuiCtrlCreateButton ("hilight",0,10,80,20)

$myedit=GUICtrlCreateEdit ("", 0,32,600,450,$ES_AUTOVSCROLL+$WS_VSCROLL)

$file = FileOpen("C:\todo.txt", 0)

$chars = FileRead($file,99999)

GUISetState ()

GUICtrlSetData ($myedit, $chars ,1)

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Select

case $msg = $buttonH

GUICtrlSendMsg($myedit, $EM_SETSEL, $start_char, $end_char)

MsgBox(0,"", "ok",2)

EndSelect

Wend

Share this post


Link to post
Share on other sites

thanx lazycat it works fine.

just a last one

does it work too, to change the color of this part of the text?

I'mean instead of highlighting it

Share this post


Link to post
Share on other sites

thanx lazycat it works fine.

just a last one

does it work too, to change the color of this part of the text?

I'mean instead of highlighting it

<{POST_SNAPBACK}>

No as the edit control cannot received rich text :">

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  
Followers 0