LisHawj Posted April 20, 2020 Posted April 20, 2020 Good afternoon, I downloaded the ExtMsgBox UDF by Melba and wanted to learn how to disable one or more buttons. I could not figure it out and have look through the entire thread about ExtMsgBox Thread by Melba. I may have missed it but I could not find how to disable a button. I used the info tool and identified the button as [CLASS:Button; INSTANCE:3] for the "Hooray!" button but I cannot disable it. How would I use GuiCtrlSetState to disable a button for the sample code below? Any help is appreciated. #include <MsgBoxConstants.au3> #include <GUIConstants.au3> #include <ExtMsgBox.au3> #include <File.au3> #include <IE.au3> _ExtMsgBoxSet(1, 4, -1, -1, 11) $sMsg = "TEST LINE 1" & @CRLF & @CRLF $sMsg &= "TEST LINE 2" & @CRLF & @CRLF $iRetValue = _ExtMsgBox($EMB_ICONSTOP, "Yes|NO|Hooray!", "Buttons Test", $sMsg, 15) ConsoleWrite("Test 4 returned: " & $iRetValue & @CRLF)
Moderators Melba23 Posted April 21, 2020 Moderators Posted April 21, 2020 (edited) LisHawj, Why would you want a disabled button in the ExtMsgBox? You create the dialog with the specific buttons you require at the time you need it, so just do not create that button if it is not needed. And you cannot modify the buttons outside the UDF - such as using GuiCtrlSetState - as it is a blocking function and so nothing in the script affects it. M23 Edited April 21, 2020 by Melba23 Speeling 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
Skysnake Posted April 21, 2020 Posted April 21, 2020 @LisHawj if your intention is ...wanted to learn how to disable one or more buttons. Rather just start with the GuiCreate, and GuiCtrlCreate, and GuiCtrlSetState functions? What you picked out is the equivalent of a 5 speed racing car to learn to drive. Start with more basic components. Skysnake Why is the snake in the sky?
LisHawj Posted April 21, 2020 Author Posted April 21, 2020 @Melba23 - I should had been clearer with my explanation. In my script I have a deferral/snooze function that is called and once the deferral/snooze max count had elapse, then I wanted a certain button to be disabled so the users cannot defer/snooze the task anymore. In my trial and error last evening I did see that there was no way for me to do it without creating a secondary ExtMsgBox when the defferal/snooze count had elapsed. Thank you for the reply.@Skysnake - I am using ExtMsgbox because the standard UDF didn't quite meet my requirements. I am familiar with disabling and enabling GUI using the standard UDF, but wanted to see if there was a similar function within ExtMsgBox. I was not very clear in my explanation, my apology.
Moderators Melba23 Posted April 21, 2020 Moderators Posted April 21, 2020 LisHawj, I understand your request now. I feel your solution of creating a new dialog without the button when required is definitely the way to go. 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
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