Altsubmit Open or Close

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
chngrcn
Posts: 190
Joined: 29 Feb 2016, 08:55

Altsubmit Open or Close

31 Oct 2018, 13:17

Code: Select all

Gui, Add, ListView, AltSubmit x32 y70 w610 h300 , ListView
Gui, Add, CheckBox, x32 y40 w90 h20 , AltSubmit Close

Gui, Show, w656 h388, Untitled GUI
return

GuiClose:
ExitApp
Turn off the "AltSubmit" feature of the Listview when checkbox is checked
I want to open the "AltSubmit" property of Listview when checkbox is not checked.

How can I do it?
SpecialGuest
Posts: 26
Joined: 15 May 2016, 07:49

Re: Altsubmit Open or Close

31 Oct 2018, 19:03

Hi chngrcn,

I think this should help you on your way:
Add a g-label to you checkbox that when fired (on-change : (un)check) executes a label with a guicontrol command.
Depending on your checkbox' vVariable value (0/1) you will either + or - the AltSubmit option on your lisview
https://autohotkey.com/docs/commands/Gu ... tm#options ;)
https://autohotkey.com/board/topic/3470 ... entry21897

One remark: if you are going to specify a gui name later on or next time, you will need to alter your guicontrol lines as well
(...nevermind. I just saw it already states that in the Remarks section of the GuiControl help-section.)
chngrcn
Posts: 190
Joined: 29 Feb 2016, 08:55

Re: Altsubmit Open or Close

01 Nov 2018, 04:11

SpecialGuest wrote:
31 Oct 2018, 19:03
Hi chngrcn,

I think this should help you on your way:
Add a g-label to you checkbox that when fired (on-change : (un)check) executes a label with a guicontrol command.
Depending on your checkbox' vVariable value (0/1) you will either + or - the AltSubmit option on your lisview
Could you share a sample. I couldn't. Thank you
SpecialGuest
Posts: 26
Joined: 15 May 2016, 07:49

Re: Altsubmit Open or Close

01 Nov 2018, 07:04

Try this and modify to your likings :

Code: Select all

Gui, Add, CheckBox, gOnChange vCheckBoxID x20 y0 w90 h20, OFF
Gui, Add, ListView, x20 y20 w610 h300 Grid vListViewID, Column A|Column B|...
Gui, Show, w650 h340, Listview with an AltSubmit Switch
return

OnChange:
Gui, Submit, NoHide
If CheckBoxID ; = 1
{
	GuiControl, +AltSubmit, ListViewID
	GuiControl, Text, CheckBoxID, ON
}
Else If !CheckBoxID ; = 0
{
	GuiControl, -AltSubmit, ListViewID
	GuiControl, Text, CheckBoxID, OFF
}
Return

GuiClose:
ExitApp
Enjoy

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 245 guests