show or hide edit control in Autoit GUI

442 views Asked by At

I want to show or hide a edit control depending if a radio button is checked or not.The following Autoit code appears semantically ok but not working.Can anyone please help? thanks

While 1
   $nMsg = GUIGetMsg()
   $isradioChk=GUICtrlRead($radio_AbsP)##checked=1,not checked=4
   Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $isradioChk
         If $isradioChk<==1 Then
            GUICtrlSetState($edit_AbsP,$GUI_SHOW)
            GUICtrlSetState($edit_RelP,$GUI_HIDE)
         Else
            GUICtrlSetState($edit_AbsP,$GUI_HIDE)
            GUICtrlSetState($edit_RelP,$GUI_SHOW)
        EndIf
    Case $usrPrefs

    EndSwitch
WEnd
1

There are 1 answers

0
AudioBubble On

Try this:

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $radio_AbsP
            If BitAND(GUICtrlRead($radio_AbsP), $GUI_CHECKED) Then
                GUICtrlSetState($edit_AbsP,$GUI_SHOW)
                GUICtrlSetState($edit_RelP,$GUI_HIDE)
            Else
                GUICtrlSetState($edit_AbsP,$GUI_HIDE)
                GUICtrlSetState($edit_RelP,$GUI_SHOW)
            EndIf
        Case $usrPrefs

    EndSwitch
WEnd