Sign in to follow this  
Followers 0
poisonkiller

_GUICtrlEditSetSel()

2 posts in this topic

okay... here is example, what i want to do:

#include <GUIConstants.au3>
#include <GUIEdit.au3>
GUICreate("_GUICtrlEditSearchString", 300, 300)
$MyEdit = GUICtrlCreateEdit("", 10, 10, 290, 260)
$MyBut = GUICtrlCreateButton("Select", 160, 270, 50, 20)
GUISetState()
Do
    $msg = GUIGetMsg()
Select
Case $msg = $MyBut
    _SelectText($MyEdit)
    EndSelect
Until $msg = $GUI_EVENT_CLOSE



Func _SelectText($edit)
_GUICtrlEditSetSel($edit, 0, 6)
EndFunc

But it will not select text from 0 to 6.What i should to do?

Share this post


Link to post
Share on other sites



Looks like the Control need the focus for this UDF to work.

This is someting gafrost needs to look at but here is a workaround:

Func _SelectText($edit)
    GUICtrlSetState($edit,$GUI_FOCUS)
    _GUICtrlEditSetSel ($edit, 0, 6)
EndFunc  ;==>_SelectText

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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