rcrosby Posted June 30, 2006 Share Posted June 30, 2006 I need help i'm a newbie and I wanted to know if there was a way to display the contents of a text file in an edit box when a user presses a button. Link to comment Share on other sites More sharing options...
GaryFrost Posted June 30, 2006 Share Posted June 30, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now