Nova Posted January 9, 2005 Share Posted January 9, 2005 (edited) Im just messing with GUICtrlCreateEdit which ive never had a use for up till now. How do I send text to an edit control and not make it over wright previous text sent. For example GUICtrlSetData ( $MyEdit1, "Line 1") GUICtrlSetData ( $MyEdit1, "Line 2") I want the edit to look like after the the text has been set by the GUICtrlSetData commands. Line 1 Line 2 Instead line 2 just overlaps line 1 deleting it in the process and it looks like this Line 2 Im sure this is very simple but I justcant get it to work. Edited January 9, 2005 by Nova Link to comment Share on other sites More sharing options...
layer Posted January 9, 2005 Share Posted January 9, 2005 i had this problem, but after GUICtrlSetData ($MyEdit1, "Line1", 1) << you hav to had that 1 there, i remember i had this problem, but add that 1, that should do the trick! FootbaG Link to comment Share on other sites More sharing options...
Nova Posted January 9, 2005 Author Share Posted January 9, 2005 No actually that make the text pile up 1 after the other in a horizontal pattern with no spacing Like this Line1Line2Line3 Link to comment Share on other sites More sharing options...
layer Posted January 9, 2005 Share Posted January 9, 2005 ohhh, my bad, i didnt read your full post :"> why not do GUICtrlSetData ($MyEdit1, "Line1", 1) GUICtrlSetData ($MyEdit1, @CRLF, 1) GUICtrlSetData ($MyEdit1, "Line2", 1) thats what you want right? FootbaG Link to comment Share on other sites More sharing options...
Nova Posted January 9, 2005 Author Share Posted January 9, 2005 thats what you want right? Nope its not actually Link to comment Share on other sites More sharing options...
layer Posted January 9, 2005 Share Posted January 9, 2005 then what do you want?!!?!??! FootbaG Link to comment Share on other sites More sharing options...
SlimShady Posted January 9, 2005 Share Posted January 9, 2005 then what do you want?!!?!??!<{POST_SNAPBACK}>Yeah. I tested layer's script and it worked.I'll post some examples that'll do what you explained.Example 1 (changed layer's code a bit)expandcollapse popup#include <GUIConstants.au3> AutoItSetOption("TrayIconDebug", 1) ;Initialize variables Global $style1 Global $IniFile Global $GUIWidth Global $GUIHeight $GUIWidth = 250 $GUIHeight = 250 $IniFile = StringTrimRight(@ScriptFullPath, 3) & "ini" GUICreate("New GUI", $GUIWidth, $GUIHeight) $Edit_1 = GUICtrlCreateEdit("Some Text", 10, 10, 200, 200) $Button_1 = GUICtrlCreateButton("OK", 75, 215, 70, 25) GUISetState(@SW_SHOW) While 1 Sleep(25) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $Button_1 GUICtrlSetData($Edit_1, @CRLF, 1) GUICtrlSetData($Edit_1, "Line1", 1) GUICtrlSetData($Edit_1, @CRLF, 1) GUICtrlSetData($Edit_1, "Line2", 1) EndSelect WEndExample 2#include <GUIConstants.au3> AutoItSetOption("TrayIconDebug", 1) ;Initialize variables Global $style1 Global $IniFile Global $GUIWidth Global $GUIHeight $GUIWidth = 250 $GUIHeight = 250 $IniFile = StringTrimRight(@ScriptFullPath, 3) & "ini" GUICreate("New GUI", $GUIWidth, $GUIHeight) $Edit_1 = GUICtrlCreateEdit("Some Text", 10, 10, 200, 200) $Button_1 = GUICtrlCreateButton("OK", 75, 215, 70, 25) GUISetState(@SW_SHOW) While 1 Sleep(25) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $Button_1 GUICtrlSetData($Edit_1, @CRLF & "Line1" & @CRLF & "Line2", 1) EndSelect WEndexpandcollapse popupExample 3 [code]#include <GUIConstants.au3> AutoItSetOption("TrayIconDebug", 1) ;Initialize variables Global $style1 Global $IniFile Global $GUIWidth Global $GUIHeight $GUIWidth = 250 $GUIHeight = 250 $IniFile = StringTrimRight(@ScriptFullPath, 3) & "ini" GUICreate("New GUI", $GUIWidth, $GUIHeight) $Edit_1 = GUICtrlCreateEdit("Some Text", 10, 10, 200, 200) $Button_1 = GUICtrlCreateButton("OK", 75, 215, 70, 25) GUISetState(@SW_SHOW) While 1 Sleep(25) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $Button_1 $Content = GUICtrlRead($Edit_1) GUICtrlSetData($Edit_1, $Content & @CRLF & "Line1" & @CRLF & "Line2") $Content = 0 EndSelect WEnd Link to comment Share on other sites More sharing options...
Nova Posted January 9, 2005 Author Share Posted January 9, 2005 Tnx for the examples Slim im quite good with the new GUI functions, its just I havnt used ctrledit before and ive never crossed a simular issue either. Im sure ill get it doing what I want now. Cheers Nova 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