Jump to content

Recommended Posts

Posted

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
Posted (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 by Melba23
Speeling

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

 

Posted

@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?

Posted

@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
Posted

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

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

 

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
  • Recently Browsing   0 members

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