Kivin Posted March 16, 2007 Share Posted March 16, 2007 Hi everyone! I can't understand how to read whole txt file & set it data into Editbox. Tnks Link to comment Share on other sites More sharing options...
Josbe Posted March 16, 2007 Share Posted March 16, 2007 Hi everyone! I can't understand how to read whole txt file & set it data into Editbox. Tnks Check this proof-of-concept script: #include <GuiConstants.au3> GuiCreate("MyGUI", 361, 261,-1, -1 ) $Edit_1 = GuiCtrlCreateEdit("My default text.", 10, 10, 340, 190) $Button_2 = GuiCtrlCreateButton("File 2 EDIT", 20, 220, 90, 30) GuiSetState() While 1 $msg = GuiGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $Button_2 _file2Edit() EndSwitch WEnd Exit Func _file2Edit() $file = FileOpen(@ScriptFullPath, 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $sContent = FileRead($file) GUICtrlSetData($Edit_1, $sContent) FileClose($file) EndFunc Read the examples in the helpfile. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta 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