yellow Posted February 15, 2006 Share Posted February 15, 2006 (edited) Look at my script , I don't know why I can't add the @CRLF. when I use it the window can't display properly. opt("GUIOnEventMode",1)#include <GUIConstants.au3>$mainwindow=GUICreate("My GUI edit") GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")$myedit=GUICtrlCreateEdit ("", 176,32,121,97,$ES_AUTOVSCROLL+$WS_VSCROLL)GUISetState ()$file = FileOpen("c:\test.txt", 0)If $file = -1 Then GUICtrlSetData ($myedit,"NO Log",1)EndIfWhile 1 $line = FileReadLine($file) GUICtrlSetData ($myedit,$line & @CRLF,1) If @error = -1 Then ExitLoop WendFileClose($file)Func CLOSEClicked() If @GUI_WINHANDLE = $mainwindow Then Exit EndIf EndFunc Edited February 15, 2006 by yellow Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 15, 2006 Share Posted February 15, 2006 have you ever tried GUICtrlSetData ($myedit,$line & @CRLF); instead of GUICtrlSetData ($myedit,$line & @CRLF, 1) this should work - at least it does on my pc my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
yellow Posted February 15, 2006 Author Share Posted February 15, 2006 have you ever tried GUICtrlSetData ($myedit,$line & @CRLF); instead of GUICtrlSetData ($myedit,$line & @CRLF, 1) this should work - at least it does on my pc It still can't work well in my pc! I can't see any lines. But thanx for your reply! Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 15, 2006 Share Posted February 15, 2006 your script works! (now) #include <file.au3> opt("GUIOnEventMode",1) #include <GUIConstants.au3> $mainwindow=GUICreate("My GUI edit") GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $myedit=GUICtrlCreateEdit ("", 176,32,121,97,$ES_AUTOVSCROLL+$WS_VSCROLL) GUISetState () $file = "c:\test.txt" If not FileExists($file) Then GUICtrlSetData ($myedit,"NO Log",1) EndIf $line = _filecountlines ($file) msgbox (0, $line, $line) for $i = 1 to $line step 1 $line = FileReadLine($file, $i) GUICtrlSetData ($myedit,$line & @CRLF,1) next Func CLOSEClicked() If @GUI_WINHANDLE = $mainwindow Then Exit EndIf EndFunc while 1 sleep (100) WEnd this should work by now you just made a little mistake my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
yellow Posted February 15, 2006 Author Share Posted February 15, 2006 That's good! I will check why I am wrong. Thanks! Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 15, 2006 Share Posted February 15, 2006 the problem was the filereadline - it never stopped, so i made a little workaround by counting the lines, ... my little chatmy little encryption toolmy little hidermy unsafe clickbot 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