Guest niwre22 Posted June 14, 2005 Share Posted June 14, 2005 (edited) Hi,I have a problem with bij GUI, and I can't find in the helpfile... What's my problem:$Edit_1 = GUICtrlCreateEdit("My story about myself: {ENTER} Hi! {ENTER} ...", 50, 182, 498,)I would like type a story in the textbox, but if I type: {ENTER}, the line doesn't go done... (Enter)How can I fix that problem?The people can read the text, but also edit the text! How can I do that people alone read the text, en NOT edit the text?Thx!Niwre22 Edited June 14, 2005 by niwre22 Link to comment Share on other sites More sharing options...
buzz44 Posted June 14, 2005 Share Posted June 14, 2005 Welcome . To simulate a line break in AutoIt we use... @CR Carriage return, Chr(13); sometimes used for line breaks. @LF Line feed, Chr(10); typically used for line breaks. @CRLF = @CR & @LF ;occasionally used for line breaks. $Edit_1 = GUICtrlCreateEdit("My story about myself: " & @CRLF & "Hi!" & @CRLF & "...", 50, 182, 498,) For more information type one of the above into the help file. qq Link to comment Share on other sites More sharing options...
Guest niwre22 Posted June 14, 2005 Share Posted June 14, 2005 thanks Burrup, It works now great! About my second question... Is this also possible with AutoIT? Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted June 14, 2005 Share Posted June 14, 2005 (edited) thanks Burrup,It works now great! About my second question...Is this also possible with AutoIT?<{POST_SNAPBACK}>Something like this?GUICtrlCreateedit("You can't edit me",20,20,300,200,$ES_READONLY)OrGUICtrlCreateedit("You can't edit me",20,20,300,200) GUICtrlSetState(-1,$GUI_DISABLE) Edited June 14, 2005 by Wb-FreeKill Link to comment Share on other sites More sharing options...
quick_sliver007 Posted June 14, 2005 Share Posted June 14, 2005 Seeing that this is for a story, you may want to look at the $WS_VSCROLL style too. To add a scroll bar to the Edit. Like this also.............. GuiCreate("MyGUI", 500, 500) $Edit_1 = GUICtrlCreateEdit("My story about myself: " & @CRLF & "Hi!" & @CRLF & "...", 0, 0, 500,500,$ES_READONLY + $WS_VSCROLL) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case Else ;;; EndSelect WEnd . Link to comment Share on other sites More sharing options...
Guest niwre22 Posted June 14, 2005 Share Posted June 14, 2005 (edited) I can't edit the text! But... The background of the edit box is black, and it must be White. Thx for help! Edited June 14, 2005 by niwre22 Link to comment Share on other sites More sharing options...
buzz44 Posted June 14, 2005 Share Posted June 14, 2005 #include <GUIConstants.au3> Global Const $EM_SETREADONLY = 0xCF GUICreate("MyGUI", 300, 200) $Edit = GUICtrlCreateEdit("My story about myself: " & @CRLF & "Hi!" & @CRLF & "...", 0, 0, 200,200, $ES_READONLY + $WS_VSCROLL) $check = GUICtrlCreateCheckbox ("Read Only?", 210, 10, 100, 20) GUICtrlSetState($check, $GUI_CHECKED) GUICtrlSetBkColor ($Edit, 0xFFFFFF) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $check If $check = $GUI_CHECKED Then GUICtrlSetStyle ($Edit, $ES_READONLY + $WS_VSCROLL) ElseIf $check = $GUI_UNCHECKED Then GUICtrlSetStyle ($Edit, $EM_SETREADONLY + $WS_VSCROLL) EndIf EndSelect WEnd The check box works but setting the style to $ES_READONLY/$EM_SETREADONLY doesn't. I believe it is a bug that should be fixed and I have submitted it to the 'Bug Reports' forum. qq Link to comment Share on other sites More sharing options...
blindwig Posted June 14, 2005 Share Posted June 14, 2005 The check box works but setting the style to $ES_READONLY/$EM_SETREADONLY doesn't. I believe it is a bug that should be fixed and I have submitted it to the 'Bug Reports' forum.<{POST_SNAPBACK}>I had similiar issues setting the editbox to readonly or readwrite after creation. I got it working. Here's the thread:http://www.autoitscript.com/forum/index.ph...topic=10744&hl= My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions 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