Selection menu with two tabs

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Didier3L
Posts: 14
Joined: 27 Dec 2016, 09:33

Selection menu with two tabs

11 Jan 2017, 08:11

Hello,
I made a selection menu with two tabs
I can start my programs with my first tab but not with the second one
Could you help me ?

Bonjour,
J'ai réalisé un menu de selection avec deux onglets
J'arrive à lancer mes programmes avec mon premier onglet mais pas avec le deuxième
Pourriez vous m'aider ?

Code: Select all

; Example: Tab control:

Gui, add, Tab2,, Onglet 1|Onglet 2
Gui, Add, Radio, vMyRadio, Programme1
Gui, Add, Radio,, Programme2
Gui, Add, Button, default xm, OK ; xm Place le OK en bas à gauche

; Onglet 2
Gui, Tab, Onglet 2
Gui, Add, Radio,, Programme3
Gui, Add, Radio,, Programme4
Gui, Add, Button, default xm, OK ; xm Place le OK en bas à gauche

Gui, Show , w220
return

ButtonOK:
GuiClose:
GuiEscape:

Gui, Submit ; Enregistre le contenu de chaque contrôle à sa variable associée.

MsgBox Programme choisi : `n%MyRadio%

;----------------------------------------------------------------------
;----   Programme1
;----------------------------------------------------------------------
If (MyRadio = 1)
{
Run, C:\Programme1.ahk
ExitApp
}
;----------------------------------------------------------------------
;----   Programme2
;----------------------------------------------------------------------
If (MyRadio = 2)
{
Run, C:\Programme2.ahk
}
;----------------------------------------------------------------------
;----   Programme3
;----------------------------------------------------------------------
If (MyRadio = 3)
{
Run, C:\Programme3.ahk
ExitApp
}
;----------------------------------------------------------------------
;----   Programme4
;----------------------------------------------------------------------
If (MyRadio = 4)
{
Run, C:\Programme4.ahk
ExitApp
}

ExitApp
Didier3L
Posts: 14
Joined: 27 Dec 2016, 09:33

Re: Selection menu with two tabs

11 Jan 2017, 14:47

I read but I do not know what to change :(
garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: Selection menu with two tabs

11 Jan 2017, 16:52

I think , I made complicated ...

Code: Select all

Gui, Add, Tab2,vTAB ,A|B
  Gui, Tab, A
Gui, Add, Radio, vMyRadioA, Programme1
Gui, Add, Radio,          , Programme2
Gui, Add, Button, gA1 default xm, OK
  Gui, Tab, B
Gui, Add, Radio, vMyRadioB , Programme3
Gui, Add, Radio,           , Programme4
Gui, Add, Button, gA1 default xm, OK
Gui, Show , w220
return
Guiclose:
exitapp

a1:
Gui,submit,nohide
if (TAB="A")
 {
 If (MyRadioA = 1)
    msgbox,1
 If (MyRadioA = 2)
    msgbox,2
 }
if (TAB="B")
 {
 If (MyRadioB = 1)
    msgbox,3
 If (MyRadioB = 2)
    msgbox,4
 }
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: DecimalTurn, Google [Bot], macromint, peter_ahk and 360 guests