在GUI中创建复选框

时间:2013-08-17 06:27:47

标签: autohotkey

我创建了一个复选框,然后是GUI。但是,我想在同一个GUI中创建另一个复选框,但它告诉我需要在下面的BOLD部分输入“return”。

如果我这样做,我脚本的其余部分将停止。基本上,如果用户检查YES,那么我想要该GUI中的第二个GUI。但是如果用户检查NO,那么我希望热键跳到脚本的其余部分(下面没有包含)。

我怎么能这样做?

Send, {ENTER}
gui, font, s14
gui, add, checkbox, w200 y15 vyesy, YES
gui, add, checkbox, w200 vnon, NO
gui, add, button,  gfem, continue
gui, show, w200 h175, GYN EXAM?
Return

fem:
Gui, submit
Send, {space}
Sleep, 500


if non = 1
 {
 send, {space}
 }
gui, destroy
If yesy = 1
{
Send,GYN:{SPACE}
Progress, m2 b fs14 zh0, Date of LMP, , , Arial
Inputbox, LMP, LMP 
Progress, Off
Sleep, 500
Send,LMP{SPACE}%LMP%,{SPACE}
Progress, m2 b fs14 zh0, Duration`ndays wks mo  , , , Arial
Inputbox, duration, Duration 
Progress, Off
Sleep, 500
Send, Duration{SPACE}%duration%,{SPACE}
Progress, m2 b fs14 zh0, G_/P_ `nPlease include letters G&P, , , Arial
Inputbox, gp, G_/P_ 
Progress, Off
Sleep, 500
Send,%gp%{SPACE}

gui, font, s14
gui, add, checkbox, w115 y15 virreg, Irregular
gui, add, checkbox, w115 vhflow, Heavy flow
gui, add, checkbox, w115 vndys, Dysmenorrhia
gui, add, checkbox, w115 y15 x+8 vreg, Regular
gui, add, checkbox, w150 y+9 vflow, Normal flow
gui, add, checkbox, w200 y+9 vdysmenorrhia, No Dysmenorrhia
gui, Add, button, x120 y130 gGyYN, continue 
gui, Show, w400 h200, GYN
return


GYyN:
gui, Submit
SEND,{space}
Sleep, 500

if irreg = 1
 {
  send, -{space}Irregular{space}
Progress, m2 b fs14 zh0, Further details of `nirregular flow, , , Arial
Inputbox, irf, Irregular flow details
Progress, Off
Sleep, 500
Send,%irf%

 }
if hflow = 1
 {
  send, -{SPACE}Heavy flow{space}
Progress, m2 b fs14 zh0, Further details of `nheavy flow, , , Arial
Inputbox, hfl, Heavy flow details
Progress, Off
Sleep, 500
Send,%hfl%
 }
if ndys = 1
 {
  send, -{space}Dysmenorrhia{space}
Progress, m2 b fs14 zh0, Further details of `ndysmenorrhia, , , Arial
Inputbox, dysmni, Dysmenorrhia details
Progress, Off
Sleep, 500
Send,%dysmni%
  - Normal flow- No Dysmenorrhia
 }
if reg = 1
 {
  send, -{space}Regular
 }  
if flow = 1
 {
  send, -{space}Normal flow
 }
if dysmenorrhia = 1
 {
  send, -{SPACE}No Dysmenorrhia
**return**
 }}
gui, destroy

1 个答案:

答案 0 :(得分:0)

AHK不喜欢你打开第二个GUI     如果是= 1 块。如果你这样写,错误就会消失。

Send, {ENTER}
gui, font, s14
gui, add, checkbox, w200 y15 vyesy, YES
gui, add, checkbox, w200 vnon, NO
gui, add, button,  gfem, continue
gui, show, w200 h175, GYN EXAM?
Return

fem:
Gui, submit
Send, {space}
Sleep, 500

gui, destroy

if non = 1
 {
 send, {space}
 }

If yesy <> 1
  return


Send,GYN:{SPACE}
Progress, m2 b fs14 zh0, Date of LMP, , , Arial
Inputbox, LMP, LMP 
Progress, Off
Sleep, 500

Send,LMP{SPACE}%LMP%,{SPACE}
Progress, m2 b fs14 zh0, Duration`ndays wks mo  , , , Arial
Inputbox, duration, Duration 
Progress, Off
Sleep, 500

Send, Duration{SPACE}%duration%,{SPACE}
Progress, m2 b fs14 zh0, G_/P_ `nPlease include letters G&P, , , Arial
Inputbox, gp, G_/P_ 
Progress, Off
Sleep, 500

Send,%gp%{SPACE}

gui, font, s14
gui, add, checkbox, w115 y15 virreg, Irregular
gui, add, checkbox, w115 vhflow, Heavy flow
gui, add, checkbox, w115 vndys, Dysmenorrhia
gui, add, checkbox, w115 y15 x+8 vreg, Regular
gui, add, checkbox, w150 y+9 vflow, Normal flow
gui, add, checkbox, w200 y+9 vdysmenorrhia, No Dysmenorrhia
gui, Add, button, x120 y130 gGyYN2, continue 
gui, Show, w400 h200, GYN
return


GYyN2:
gui, Submit
SEND,{space}
Sleep, 500

if irreg = 1
 {
  send, -{space}Irregular{space}
Progress, m2 b fs14 zh0, Further details of `nirregular flow, , , Arial
Inputbox, irf, Irregular flow details
Progress, Off
Sleep, 500
Send,%irf%

 }

if hflow = 1
 {
  send, -{SPACE}Heavy flow{space}
Progress, m2 b fs14 zh0, Further details of `nheavy flow, , , Arial
Inputbox, hfl, Heavy flow details
Progress, Off
Sleep, 500
Send,%hfl%
 }

if ndys = 1
 {
  send, -{space}Dysmenorrhia{space}
Progress, m2 b fs14 zh0, Further details of `ndysmenorrhia, , , Arial
Inputbox, dysmni, Dysmenorrhia details
Progress, Off
Sleep, 500
Send,%dysmni%
  - Normal flow- No Dysmenorrhia
 }

if reg = 1
 {
  send, -{space}Regular
 }  

if flow = 1
 {
  send, -{space}Normal flow
 }

if dysmenorrhia = 1
 {
  send, -{SPACE}No Dysmenorrhia

 }

 gui, destroy