Silvinho Posted November 15, 2007 Share Posted November 15, 2007 How to type a value in an edit from the data of a file txt?. thank's Link to comment Share on other sites More sharing options...
McGod Posted November 16, 2007 Share Posted November 16, 2007 #include <GUIConstants.au3> $Form1 = GUICreate("Import File to Editbox", 633, 454, 193, 115) $Edit1 = GUICtrlCreateEdit("", 8, 32, 617, 417) $Button1 = GUICtrlCreateButton("Import File to Edit box", 160, 0, 305, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Local $sFile = FileOpenDialog("Import File", @ScriptDir, "All (*.*)") ImportToEdit($Edit1, $sFile) EndSwitch WEnd Func ImportToEdit($Edit, $File) Local $sInfo = FileRead($File, FileGetSize($File)) If @error Then Return GUICtrlSetData($Edit, $sInfo) Return EndFunc Try that, it will read a file and put the contents into a edit box. I put the actual code into a function so it's "portable". [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] 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