Seminko Posted August 30, 2014 Share Posted August 30, 2014 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? Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted August 30, 2014 Moderators Solution Share Posted August 30, 2014 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 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 Link to comment Share on other sites More sharing options...
Seminko Posted August 30, 2014 Author Share Posted August 30, 2014 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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 30, 2014 Moderators Share Posted August 30, 2014 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 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 Link to comment Share on other sites More sharing options...
mikell Posted August 30, 2014 Share Posted August 30, 2014 Give focus to another control trancexx 1 Link to comment Share on other sites More sharing options...
Seminko Posted August 30, 2014 Author Share Posted August 30, 2014 (edited) 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 August 30, 2014 by Seminko Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 30, 2014 Moderators Share Posted August 30, 2014 Seminko,You do not seem to have a lot of luck running my scripts today. 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 WEndAny luck? M23 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 Link to comment Share on other sites More sharing options...
mikell Posted August 30, 2014 Share Posted August 30, 2014 Melba, It was matter of saving about 800 Kb of include(s) which can be useless if not needed elsewhere in the script Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 30, 2014 Moderators Share Posted August 30, 2014 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 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 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