change grouped radio buttons with GuiControl not working? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
smarq8
Posts: 69
Joined: 16 Jan 2016, 00:33

change grouped radio buttons with GuiControl not working?

22 Aug 2017, 05:16

i try to change my grouped radio button using GuiControl but seomthing geos wrong and not working.

Code: Select all

Gui Add, Radio,  x+0 w52 h10 vv_ShiftMode Group   , ALL
Gui Add, Radio,  y+0 w52 h10 Checked              , FROM
Gui Add, Radio,  y+0 w52 h10                      , SEL

GuiControl,,v_ShiftMode3,1 ; it shoul change radio button to "SEL" but it wont
gui, Show, w200 h100
return

f4::reload

my ahk ver 1.1.26.01 u32
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: change grouped radio buttons with GuiControl not working?

22 Aug 2017, 05:27

Try this:

Code: Select all

Gui Add, Radio,  x+0 w52 h10 vv_ShiftMode Group   , ALL
Gui Add, Radio,  y+0 w52 h10 Checked              , FROM
Gui Add, Radio,  y+0 w52 h10                      , SEL
gui, Show, w200 h100
return

f12:: GuiControl,,Button3,1 ; it selects radio button "SEL"

f4::reload
I hope that helps.
smarq8
Posts: 69
Joined: 16 Jan 2016, 00:33

Re: change grouped radio buttons with GuiControl not working?

22 Aug 2017, 05:48

what if i have many other gui elements? It must somehow to be corelated with ahk var name (v_ShiftMode)
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: change grouped radio buttons with GuiControl not working?  Topic is solved

22 Aug 2017, 05:57

Code: Select all

Gui, Add, Radio,  w52 vv_ShiftMode Group   HwndHShiftMode1, ALL
Gui, Add, Radio,  w52 Checked              HwndHShiftMode2, FROM
Gui, Add, Radio,  w52                      HwndHShiftMode3, SEL
Gui, Show, w200 h100
Sleep, 1000
GuiControl,,%HShiftMode3%,1 ; it shoul change radio button to "SEL" but it wont
Return

f4::reload
smarq8
Posts: 69
Joined: 16 Jan 2016, 00:33

Re: change grouped radio buttons with GuiControl not working?

22 Aug 2017, 11:32

so its not possible to do with using only "v_ShiftMode" var?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Dewi Morgan and 381 guests