Jump to content

How to?!


Recommended Posts

Hi.

I have created a GUI and now want to put in some read only text. I have done this fine and used the correct syntax. What I now need to know is

how to go to a new line once I get to the borders of my textbox.

Considering I am doing this in code I will need a method (such as "{enter}" - already tried, does not work, just prints {enter} and then dissappears off the side of my textbox).

So basically what I am asking for is how to create a carridge return using SCITE for a GUI input box.

Thanks.

If you need an example of the code of the box, here it is:

GuiCtrlCreateInput("Terms And Conditions for P B's 'M' Software.", 40, 70, 310, 150, _
    BitOR($ES_MULTILINE, $ES_WANTRETURN, $PBS_VERTICAL, $PBS_SMOOTH, $ES_AUTOVSCROLL, $ES_READONLY, $ES_CENTER), $WS_EX_CLIENTEDGE)

I want to continue the "Terms And Conditions for P B's 'M' Software." infinately and not have to worry about it dissappearing out the side of my textbox, but going down and allowing the user to scrol.

Thank You.

 Run (Brain.exe)
.
Link to comment
Share on other sites

Hi.

I have created a GUI and now want to put in some read only text. I have done this fine and used the correct syntax. What I now need to know is

how to go to a new line once I get to the borders of my textbox.

Considering I am doing this in code I will need a method (such as "{enter}" - already tried, does not work, just prints {enter} and then dissappears off the side of my textbox).

So basically what I am asking for is how to create a carridge return using SCITE for a GUI input box.

Thanks.

If you need an example of the code of the box, here it is:

GuiCtrlCreateInput("Terms And Conditions for P B's 'M' Software.", 40, 70, 310, 150, _
    BitOR($ES_MULTILINE, $ES_WANTRETURN, $PBS_VERTICAL, $PBS_SMOOTH, $ES_AUTOVSCROLL, $ES_READONLY, $ES_CENTER), $WS_EX_CLIENTEDGE)

I want to continue the "Terms And Conditions for P B's 'M' Software." infinately and not have to worry about it dissappearing out the side of my textbox, but going down and allowing the user to scrol.

Thank You.

You need to read the help for GuiCtrlCreateInput

$ES_MULTILINE is always reset.

Use an Edit control, and use @CRLF for line breaks.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

You need to read the help for GuiCtrlCreateInput

Use an Edit control, and use @CRLF for line breaks.

Can you provide an example of an Edit control please? I have been through the ones in the Help file and all that are applicable are in my script.

Edited by Wikipete
 Run (Brain.exe)
.
Link to comment
Share on other sites

Can you provide an example of an Edit control please? I have been through the ones in the Help file and all that are applicable are in my script.

#include <GUIConstantsEx.au3>
#include <editconstants.au3>
#include <windowsconstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $file, $btn, $msg
    
    GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
    $file = GUICtrlCreateEdit("", 10, 5, 300, 80,BitOR($ES_MULTILINE, $ES_WANTRETURN,   $ES_AUTOVSCROLL, $ES_READONLY, $ES_CENTER), $WS_EX_CLIENTEDGE) 
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    $btn = GUICtrlCreateButton("Ok", 40, 90, 60, 20)
    GUICtrlSetData($file, "abc" & @CRLF & "def")
    GUISetState()

    $msg = 0
    While $msg <> $GUI_EVENT_CLOSE
        $msg = GUIGetMsg()
        Select
            Case $msg = $btn
                ExitLoop
        EndSelect
    WEnd

    MsgBox(4096, "drag drop file", GUICtrlRead($file))
EndFunc  ;==>Example
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...