Jump to content
Sign in to follow this  
Seminko

GUI - $ES_NUMBER

Recommended Posts

Seminko

Hey fellas,

I'm trying to incorporate $ES_NUMBER into my GUI but for some reason I am still able to input non-numbers.

Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("", 400, 262, -1, -1, $WS_POPUP)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$Pic1 = GUICtrlCreatePic("winnquit.jpg", 0, 0, 400, 262)
GUICtrlSetState(-1, $GUI_DISABLE)
$Input1 = GUICtrlCreateInput("30", 303, 92, 40, 26, -1, $ES_NUMBER)
GUICtrlSetFont(-1, 15, 400, 0, "Belwe Bd BT")
GUICtrlSetLimit(-1, 3)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 312, 148, 13, 13)
GUICtrlSetOnEvent(-1, "Checkbox1Click")
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 312, 195, 13, 13)
GUICtrlSetOnEvent(-1, "Checkbox2Click")
$Button1 = GUICtrlCreateButton("Start!", 14, 200, 83, 49)
GUICtrlSetOnEvent(-1, "Button1Click")
GUICtrlSetFont(-1, 15, 400, 0, "Belwe Bd BT")
GUISetState(@SW_SHOW)

Ideas pls?

Share this post


Link to post
Share on other sites
Melba23

Seminko,

Try putting the style value in the correct parameter: ;)

$Input1 = GUICtrlCreateInput("30", 303, 92, 40, 26, $ES_NUMBER)
M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Seminko

lolz

Why was I convinced it was an extended style? :-D

 

BTW, is there a way for the default text in the inputbox not to be selected when the gui is created?

Thanks

Share this post


Link to post
Share on other sites
Melba23

Seminko,

Use _GUICtrlEdit_SetSel. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Seminko

Seminko,

Use _GUICtrlEdit_SetSel. :)

M23

For some reason does not seem to work for me

Give focus to another control  :)

Yea, switched the order with a tickbox and it is not selected anymore.

 

Thank you both!

Edited by Seminko

Share this post


Link to post
Share on other sites
Melba23

Seminko,

You do not seem to have a lot of luck running my scripts today. :D

Try this and see if it works for you:

#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>

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

$cInput = GUICtrlCreateInput("Will this be highlighted?", 10, 10, 200, 20)

GUISetState()

; Must be AFTER the GUI is shown <<<<<<<<<<<<<<<<
_GUICtrlEdit_SetSel($cInput, -1, -1)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Any luck? ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
mikell

Melba,

It was matter of saving about 800 Kb of include(s) which can be useless if not needed elsewhere in the script  :)

Share this post


Link to post
Share on other sites
Melba23

mikell,

Just use Au3Stripper to remove all unneeded functions and constants - no need to worry about additional includes then. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
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
Sign in to follow this  

×