20211014 1626 

 

[1] "https://www.autohotkey.com/board/topic/82731-checkboxes-2-methods-of-getting-a-value/"

 

01 checkbox에 이벤트가 발생할 때

1) subroutine으로 보내거나(g-variable)

2) 변수에 값을 넣을수 있다(v-variable)

 

그런데

02 변화된 이벤트를 받기 위해서는 gui를 refresh 해주어야 한다 [1]

 

예를 들어 다음 코드는 checkbox를 체크해도 그 값이 반영되지 않는다.

Gui, Add, CheckBox, gLabel1 vVar1, select check value
Gui, Add, Button, Default gBtn, &Close
Gui, Show,, this is test
return

Label1:
  MsgBox, %Var1%
  return

Btn:
  Gui, submit, nohide
  Gui, Destroy
  return

ExitApp

반영되기 위해서는 다음과 같이 해야 한다.

Gui, Add, CheckBox, gLabel1 vVar1, select check value
Gui, Add, Button, Default gBtn, &Close
Gui, Show,, this is test
return

Label1:
  Gui, submit, nohide
  MsgBox, %Var1%
  return

Btn:
  Gui, submit, nohide
  Gui, Destroy
  return

ExitApp

 

Posted by Weneedu
,


출처: https://privatedevelopnote.tistory.com/81 [개인노트]