0

我想根据是否选中单选按钮来显示或隐藏编辑控件。以下Autoit代码在语义上显示正常但不起作用。有人可以帮忙吗?谢谢

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
4

1 回答 1

0

尝试这个:

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    
于 2016-12-17T19:25:20.760 回答