|
本帖最后由 auhj887 于 2010-4-29 11:41 编辑
看了论坛好几天,模仿做了一个选择打开Autoit帮助的小程序,不知道,为什么点击radio选择后,点按钮不不起作用,请大家帮看看。。。。谢谢
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 202, 255, 199, 177)
GUICtrlSetOnEvent(-1, "Form1Close")
$Radio1 = GUICtrlCreateRadio("Radio1", 40, 40, 113, 17)
GUICtrlSetOnEvent(-1, "rd_1")
$Radio2 = GUICtrlCreateRadio("Radio2", 40, 80, 113, 17)
GUICtrlSetOnEvent(-1, "rd_2")
$Button1 = GUICtrlCreateButton("Button1", 40, 176, 105, 41)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Local $radio1, $radio2, $msg
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If GUICtrlRead( $Radio1 ) = 1 Then
rd_1()
ElseIf GUICtrlRead( $Radio2 ) = 1 Then
rd_2()
Else
endif
Button1Click()
EndSwitch
Wend
Func rd_1()
ControlCommand ("AutoIt Help", "", "[ID:1001]", "SelectString", 'control')
EndFunc
Func rd_2()
ControlCommand ("AutoIt Help", "", "[ID:1001]", "SelectString", '字符串')
EndFunc
Func Button1Click()
ControlClick("AutoIt Help","","[ID:1006]","")
EndFunc
Func Form1Close()
Exit
EndFunc |
|