Jump to content

need help with text in an edit box


 Share

Recommended Posts

here's one way.

#include <GUIConstants.au3>

$filename = @ScriptDir & '\myfile.txt'

GUICreate("My GUI edit", 500, 500)  ; will create a dialog box that when displayed is centered

$myedit = GUICtrlCreateEdit("", 10, 10, 480, 450, $ES_AUTOVSCROLL + $WS_VSCROLL)
$btn = GUICtrlCreateButton("Read file", 225, 475, 90, 20)
GUISetState()


; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $btn
            GUICtrlSetData($myedit, FileRead($filename, FileGetSize($filename)))
    EndSelect
    
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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