Jump to content

Recommended Posts

Posted

Hi.

I have a GUI where there are 3 radios.

Let's say the question is "how old are you", and $radio1 says 10, while $radio2 says 20. I'd like $radio3 to be an input square where you can put your age if it's neither 10 nor 20. I'd like this square to be gray (GUICtrlSetState(-1, $GUI_Disable)) unless $radio3 is checked.

My problem is that if I click on $radio3 then on $radio2, the input square is "enabled" but I'd like it to become "disabled" again.

I hope you have understood my question and I hope you'll be able to help me, as I believe my script is too long and too complicated to be posted here.

Regards.

Posted

Something like this (taken from the help file for GUICtrlCreateRadio):

#include <GUIConstantsEx.au3>

GUICreate("Test")
$radio1 = GUICtrlCreateRadio("Radio 1", 10, 10, 120, 20)
$radio2 = GUICtrlCreateRadio("Radio 2", 10, 40, 120, 20)
$radio3 = GUICtrlCreateRadio("Radio 3", 10, 70, 120, 20)
$input  = GuiCtrlCreateInput("Input",10,100,120,20)
          GUICtrlSetState(-1, $GUI_Disable)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $radio1 or $msg = $radio2
            GUICtrlSetState($input, $GUI_Disable)
        Case $msg = $radio3
            GUICtrlSetState($input, $GUI_Enable)
    EndSelect
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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