how to add editbox using checkbox? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
KongKing
Posts: 76
Joined: 22 May 2022, 09:41

how to add editbox using checkbox?

Post by KongKing » 22 May 2022, 09:48

Can you tell me how to add editbox using checkbox and when checkbox is unchecked, editbox disappears? :crazy:


[Mod action: Moved topic from "Looking for Volunteers in other languages"]

User avatar
mikeyww
Posts: 27095
Joined: 09 Sep 2014, 18:38

Re: how to add editbox using checkbox?  Topic is solved

Post by mikeyww » 22 May 2022, 10:00

Welcome to this AutoHotkey forum!

Code: Select all

Gui, Font, s10
Gui, Add, Checkbox, w250 vchecked gCheck, &Edit
Gui, Add, Edit    , wp   vdetail  Hidden
Gui, Show,, Edit
Return
Check:
Gui, Submit, NoHide
If checked {
       GuiControl, Show , detail
       GuiControl, Focus, detail
} Else GuiControl, Hide , detail
Return

KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Re: how to add editbox using checkbox?

Post by KongKing » 22 May 2022, 11:22

thanks you :D

KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Re: how to add editbox using checkbox?

Post by KongKing » 22 May 2022, 12:33

And I have a question, do you know how to get some text added to this edit box immediately after clicking the checkbox?

User avatar
mikeyww
Posts: 27095
Joined: 09 Sep 2014, 18:38

Re: how to add editbox using checkbox?

Post by mikeyww » 22 May 2022, 13:07

Code: Select all

Gui, Font, s10
Gui, Add, Checkbox, w250 vchecked gCheck, &Edit
Gui, Add, Edit    , wp   vdetail  Hidden, Text added immediately
Gui, Show,, Edit
Return
Check:
Gui, Submit, NoHide
If checked {
       GuiControl, Show , detail
       GuiControl, Focus, detail
} Else GuiControl, Hide , detail
Return
Have a look at :arrow: Gui for more options & details.

garry
Posts: 3774
Joined: 22 Dec 2013, 12:50

Re: how to add editbox using checkbox?

Post by garry » 22 May 2022, 13:18

can also play with color , font, position, size x y w h

Code: Select all

e1=
(
This is an EDIT-box
Next Line
)

Gui,Color,Black,Green
Gui, Font, s12 cWhite,Lucida Console
Gui, Add, Checkbox, x20  y10 vchecked gCheck, &Edit
Gui, Add, Edit    , x100 y10 w300 h200   vdetail  Hidden,%e1%
Gui, Show,x100 y100 w450 h250 , Edit
Return
Guiclose:
Exitapp
Check:
Gui, Submit, NoHide
If checked {
       GuiControl, Show , detail
       GuiControl, Focus, detail
	   ;Guicontrol,1:,detail,%e1%  ;- or also
} Else GuiControl, Hide , detail
Return

Post Reply

Return to “Ask for Help (v1)”