murabio Posted June 6, 2014 Posted June 6, 2014 Hey all,Just a quick question. Is there a command to start a new line in GUICtrlSetData? @LF @CR @CRLF don't work with GUICtrlSetData. For example GUICtrlSetData($inputRes,"hello "&@CRLF&"world") return: hello world
JohnOne Posted June 6, 2014 Posted June 6, 2014 @LF @CR @CRLF don't work with GUICtrlSetData. Yes it does. #include <GUIConstantsEx.au3> Example() Func Example() GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUICtrlCreateEdit("", 10, 10) GUICtrlSetData(-1, "blah" & @CRLF & "blah") GUISetState(@SW_SHOW) ; will display an empty dialog box with a combo control with focus on ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc ;==>Example AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Solution JohnOne Posted June 7, 2014 Solution Posted June 7, 2014 Input controls require a style parameter... #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Example() Func Example() Local $file, $btn, $msg GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, $WS_EX_ACCEPTFILES) GUICtrlCreateInput("", 10, 35, 300, 50, $ES_MULTILINE);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetData(-1, "blah" & @CRLF & "blah") GUISetState(@SW_SHOW) $msg = 0 ; Loop until the user exits. While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() WEnd EndFunc ;==>Example AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Moderators Melba23 Posted June 7, 2014 Moderators Posted June 7, 2014 murabio,Welcome to the AutoIt forums. As JohnOne has demonstrated, GUICtrlSetData will accept @CRLF. Your problem was that an Input control is an Edit control forced to show only a single-line - using the $ES_MULTILINE style overrides this limitation and creates a standard multi-line Edit control which will show the additional lines. M23 murabio 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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