Jump to content

Recommended Posts

Posted

Especially I have the problema with the function _GUICtrlEditGetSel() and _GUICtrlEditReplaceSel, the functions doesn't works.

I download this sample.

#include <GUIConstants.au3>
#include <GuiEdit.au3>

Func Copy($contenuto)
    $a_sel = _GUICtrlEditGetSel($contenuto)
    Local $WholeEdit = GUICtrlRead($contenuto)
    Local $Trim = StringLeft(StringTrimLeft($WholeEdit, $a_sel[1]), $a_sel[2] - $a_sel[1])
    Return $Trim
EndFunc


$Form1 = GUICreate("Editor", 445, 326, 259, 177)
$contenuto = GUICtrlCreateEdit("", 72, 32, 297, 185)
GUICtrlSetData(-1, "Select text and press BOLD")
$bold = GUICtrlCreateButton("bold", 80, 232, 65, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $bold
        $Cur_Sel = Copy($contenuto)
        $Mod_Sel = "<b>" & $Cur_Sel & "</b>"
        _GUICtrlEditReplaceSel($contenuto, TRUE, $Mod_Sel)
    EndSwitch
WEnd

When I run the code, I get an error, How can I solve the next error?:

"C:\AutoIt\sample\code1.au3"(5,43) : error: _GUICtrlEditGetSel(): undefined function.

I was trying reinstall Autoit, Sctie but always is the same error.

My OS is Windows 10 64 bits.

Thanks

 

  • Developers
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

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.
  :)

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
  • Recently Browsing   0 members

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