Nova 0 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 Share this post Link to post Share on other sites
layer 2 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 Share this post Link to post Share on other sites
Nova 0 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 Share this post Link to post Share on other sites
layer 2 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 Share this post Link to post Share on other sites
Nova 0 Posted January 9, 2005 thats what you want right? Nope its not actually Share this post Link to post Share on other sites
layer 2 Posted January 9, 2005 then what do you want?!!?!??! FootbaG Share this post Link to post Share on other sites
SlimShady 1 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 Share this post Link to post Share on other sites
Nova 0 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 Share this post Link to post Share on other sites