Jump to content
Sign in to follow this  
Elishac

GUI problem

Recommended Posts

Elishac

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.

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Elishac

ok, thanks.

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  

×