Jump to content

[Help] GUIctrlcreateInput and control !


MrVietA2
 Share

Recommended Posts

Hi All ;) !

1 - I create a Input with GuictrlcreateInput() and set some data for it, that data is some text ("Hello")

Ex : $1 = GUICtrlCreateInput("Hello",200,100)

I have a question for all of you : " How can I set the other data for $1 when I turn on the script ? "

Ex : When I turn on the script in first time, the text will be "Hello"

When I turn on the script again, the text will be "How are you ?"

And again......, the text will be change to other text...

2 - I see it in other autoit program but I don't know how to do this :

Posted Image

It like GuictrlcreateEdit but I can't delete the text in it, so what is this ?

Please help me ! Thank you so much :graduated:

Edited by MrVietA2
Link to comment
Share on other sites

  • Moderators

MrVietA2,

Put the possible options into an array and then choose a random element when you start the script: :graduated:

#include <GUIConstantsEx.au3>

Global $aInputs[3] = ["Hello", "How are you", "Pretty simple really!"]

$hGUI = GUICreate("Test", 500, 500)

$hInput = GUICtrlCreateInput($aInputs[Random(0, 2, 1)], 10, 10, 200, 20)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

MrVietA2,

Just make the edit control read only. :graduated:

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>

$hGUI = GUICreate("Test", 500, 500)

$hEdit = GUICtrlCreateEdit("Try and delete me!", 10, 10, 200, 200, BitOr($GUI_SS_DEFAULT_EDIT, $ES_READONLY)) ; <<<<<<<<<<<<<<<<

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

MrVietA2,

Just make the edit control read only. ;)

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
 
$hGUI = GUICreate("Test", 500, 500)
 
$hEdit = GUICtrlCreateEdit("Try and delete me!", 10, 10, 200, 200, BitOr($GUI_SS_DEFAULT_EDIT, $ES_READONLY)) ; <<<<<<<<<<<<<<<<
 
GUISetState()
 
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

That is so good ;), thanks

When I start a new topic, I have more question want to ask, so can I ask all question in this topic :) ?

If ok then this is my question :

- How can I change icon mouse when click on other different button ? It mean when I move the mouse to some button, the mouse icon will be change !

- What is difference between @cr and @crlf ?

That is all of my question . Thanks :graduated: !

Edited by MrVietA2
Link to comment
Share on other sites

  • Moderators

MrVietA2,

Ever thought of looking in the Help file for the answers to some of these simple questions before posting? :graduated:

#include <GUIConstantsEx.au3>
 
$hGUI = GUICreate("Test", 500, 500)
 
$hButton_1 = GUICtrlCreateButton("Normal Cursor", 10, 10, 200, 30)
 
$hButton_1 = GUICtrlCreateButton("Changed Cursor", 10, 50, 200, 30)
GUICtrlSetCursor(-1, 5) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
GUISetState()
 
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

@CRLF is the standard Windows End-Of-Line (EOL) code. You can also find @CR and @LF on their own - I seem to remember that one is the Mac standard EOL and the other the Unix one, but I cannot remember which way round it is. The codes date back to line printers:

- CR = Carriage Return (return the print head to the left edge of the page)

- LF = Line Feed (Move the paper up by one line)

MS (DOS and Windows) decided to require both to signify EOL - Mac and Unix went with just the one, probably to save some space when storage was limited to tiny floppy disks.

AutoIt will deal correctly with all 3 EOL versions - the only difference appears if you use StringSplit (look in the Help file to see why!) ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hi all,

Somebody help me with the question in #7 ;) ?

I have a question want to ask :) : I design 1 GUI with 1 button ( If R.click on button then show 1 msgbox(0,"Hello","How are you ?") ). When I complie then script, it make a exe file . I run this file :

Posted Image

My exe file is show 2 icon in task bar when I press "Button", I want it show only 1 icon in taskbar when I press "Button" ( It still have 1 gui and 1 msgbox() ) . How can I do this ? Thanks :graduated: !

Edited by MrVietA2
Link to comment
Share on other sites

  • Moderators

MrVietA2,

To hide the taskbar button for the MsgBox, just set the hwnd parameter: :graduated:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$hButton = GUICtrlCreateButton("Test", 10, 10, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            MsgBox(0,"Hello","How are you ?", 0, $hGUI)
    EndSwitch

WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

MrVietA2,

I have no idea about adding non-existent cursors, sorry. :graduated:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Oh, I have some question want to ask :graduated: :

I find #Obfuscator and how can I use it for my script ?

Tools > Compile, or read helpfile.
Link to comment
Share on other sites

  • Moderators

MrVietA2,

Why not try compiling twice using a different option each time and see if you can determine the difference yourself? :graduated:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

MrVietA2,

"FileInstall compression"

Do you use FileInstall in your script? :graduated:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

MrVietA2,

Do you use FileInstall in your script? ;)

M23

Yes, I use FileInstall to add some text file, Ing file and dll file ;)

Oh I have 1 question also want to ask with GUICtrlcreateInput() :) : " I have 1 GUI, 1 Input and 1 button " Create", how can I set other text to Input when I press button " Create " "?

Ex :

#include <GUIConstantsEx.au3>
$hGUI = GUICreate("Test", 500, 500)
$hInput = GUICtrlCreateInput("", 10, 10, 200, 20)
$button = GuictrlcreateButton("Create",50,50,300,50)
GUISetState()
While 1 
Switch GUIGetMsg()    
Case $GUI_EVENT_CLOSE         
Exit  
EndSwitch
WEnd

The text : "Hello"

"How are you ?"

"What is your name ?"

When I press button button " Create " then it set random text to input ($hInput) . How can I do this ? Thanks :graduated:

Edited by MrVietA2
Link to comment
Share on other sites

  • Moderators

MrVietA2,

What do you think might be the difference between the 2 executables produced with "High/Highest" compression? :graduated:

Do you see any evidence of it? :)

As to your new question, just modify what I posted in answer to the first post in this thread. ;)

M23

P.S. Please stop quoting my posts back to me - I know what I said! ;)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...