Jump to content

_GUICtrlEditSetSel()


Recommended Posts

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?

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...