<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Работа с DropDownList (не решено)]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12182&amp;type=atom" />
	<updated>2016-11-29T08:11:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12182</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109476#p109476" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>

Gui, -DPIScale
;------------------

Gui, Add, Tab, w400 h500, 1|2|3|4

; Кнопки запуска на 1 вкладке Макросы
Gui, Add, Button, default, &amp;1
Gui, Add, Button, default, &amp;2
Gui, Add, Button, default, &amp;3
Gui, Add, Button, default, &amp;4
Gui, Add, Button, default, &amp;5

;Переход на 2 вкладку
Gui, Tab, 2

; Кнопки запуска на 2 вкладке Jira
Gui, Add, Button, default, &amp;1
Gui, Add, Button, default, &amp;2
Gui, Add, Button, default, &amp;3
Gui, Add, Button, default, &amp;4

;Переход на 3 вкладку
Gui, Tab, 3
Gui, Add, Button, default, &amp;a1
;---------------

Gui, Add, text,  vText1, Текст 1
Gui, Add, DropDownList, xp w120 y+10 vSreda gSredaL1, QAA|STT|PROR|DET

Gui, Add, text, xp y+5 vText2 Hidden Section, Текст 2
Gui, Add, DropDownList, xp y+10 Hidden vViborr2 gVibor w250, aa1|aaa1|aaaa1

Gui, Add, text, xs ys vText3 Hidden, Текст 3
Gui, Add, DropDownList, xp y+10 Hidden vViborr3 gVibor w250, aa2|aaa2|aaaa2

Gui, Add, text, xs ys vText4 Hidden, Текст 4
Gui, Add, DropDownList, xp y+10 Hidden vViborr4 gVibor w250, aa3|aaa3|aaaa3

Gui, Add, text, xs ys vText5 Hidden, Текст 5
Gui, Add, DropDownList, xp y+10 Hidden vViborr5 gVibor w250, aa4|aaa4|aaaa4


Gui, Add, Text, Hidden vTextKeys1 Section xp y+5, Кнопки 1
Gui, Add, Button, xp y+10 Hidden vButKeys1_1, &amp;Кнопка1
Gui, Add, Button, xp y+10 Hidden vButKeys1_2, &amp;Кнопка1
Buttons1 := [&quot;TextKeys1&quot;,&quot;ButKeys1_1&quot;,&quot;ButKeys1_2&quot;]

Gui, Add, Text, xs ys Hidden vTextKeys2, Кнопки 2
Gui, Add, Button, xp y+10 Hidden vButKeys2_1, &amp;Кнопка2
Gui, Add, Button, xp y+10 Hidden vButKeys2_2, &amp;Кнопка2
Buttons2 := [&quot;TextKeys2&quot;,&quot;ButKeys2_1&quot;,&quot;ButKeys2_2&quot;]

Gui, Add, Text, xs ys Hidden vTextKeys3, Кнопки 3
Gui, Add, Button, xp y+10 Hidden vButKeys3_1, &amp;Кнопка3
Gui, Add, Button, xp y+10 Hidden vButKeys3_2, &amp;Кнопка3
Buttons3 := [&quot;TextKeys3&quot;,&quot;ButKeys3_1&quot;,&quot;ButKeys3_2&quot;]

Gui, Add, Text, xs ys Hidden vTextKeys4, Кнопки 4
Gui, Add, Button, xp y+10 Hidden vButKeys4_1, &amp;Кнопка4
Gui, Add, Button, xp y+10 Hidden vButKeys4_2, &amp;Кнопка4
Buttons4 := [&quot;TextKeys4&quot;,&quot;ButKeys4_1&quot;,&quot;ButKeys4_2&quot;]
Gui, Show, , текст 
Return

SredaL1:
	ShowHide := {Hide:Buttons%ButtonsShow%}, ButtonsShow := 0
	GoSub, Show_Hide
	GuiControl, Choose, Viborr2, 0
	GuiControl, Choose, Viborr3, 0
	GuiControl, Choose, Viborr4, 0
	GuiControl, Choose, Viborr5, 0
	
	GuiControlGet, %A_GuiControl%
	if Sreda = QAA
		ShowHide := {Show:[&quot;Text2&quot;,&quot;Viborr2&quot;], Hide:[&quot;Text3&quot;,&quot;Viborr3&quot;], Hide:[&quot;Text4&quot;,&quot;Viborr4&quot;] , Hide:[&quot;Text5&quot;,&quot;Viborr5&quot;]}
	if Sreda = STT
		ShowHide := {Hide:[&quot;Text2&quot;,&quot;Viborr2&quot;], Show:[&quot;Text3&quot;,&quot;Viborr3&quot;], Hide:[&quot;Text4&quot;,&quot;Viborr4&quot;] , Hide:[&quot;Text5&quot;,&quot;Viborr5&quot;]}
	if Sreda = PROR
		ShowHide := {Hide:[&quot;Text2&quot;,&quot;Viborr2&quot;], Hide:[&quot;Text3&quot;,&quot;Viborr3&quot;], Show:[&quot;Text4&quot;,&quot;Viborr4&quot;] , Hide:[&quot;Text5&quot;,&quot;Viborr5&quot;]}		
	if Sreda = DET
		ShowHide := {Hide:[&quot;Text2&quot;,&quot;Viborr2&quot;], Hide:[&quot;Text3&quot;,&quot;Viborr3&quot;], Hide:[&quot;Text4&quot;,&quot;Viborr4&quot;] , Show:[&quot;Text5&quot;,&quot;Viborr5&quot;]}
	Goto, Show_Hide

Vibor:
	GuiControlGet, Control, , %A_GuiControl%   
	if Control in aa1,aaa1,aaaa1
		ShowHide := {Show:Buttons1, Hide:Buttons2, Hide:Buttons3 , Hide:Buttons4}, ButtonsShow := 1
		
	if Control in aa2,aaa2,aaaa2
		ShowHide := {Hide:Buttons1, Show:Buttons2, Hide:Buttons3 , Hide:Buttons4}, ButtonsShow := 2
		
	if Control in aa3,aaa3,aaaa3
		ShowHide := {Hide:Buttons1, Hide:Buttons2, Show:Buttons3 , Hide:Buttons4}, ButtonsShow := 3
		
	if Control in aa4,aaa4,aaaa4
		ShowHide := {Hide:Buttons1, Hide:Buttons2, Hide:Buttons3 , Show:Buttons4}, ButtonsShow := 4
	Goto, Show_Hide 

Show_Hide:	 
	for key, arr in ShowHide
		for i, var in arr
			GuiControl, %key%, %var% 
	Return 
</code></pre></div><p>Подскажите, сделал такой код, по вашему примеру. но у меня проблема. <br />При запуске, перейти в 3 вкладку. Там выбрать текст 1. QAA, выпадает список ааа1, если выбрать текст 1 не QAA на другое , то текст все равно тянется от QAA а не от выбранного вверху элемента.<br />По коду смотрел вроде все верно, не пойму где ошибка.<br />Буду рад помощи.</p>]]></content>
			<author>
				<name><![CDATA[Autosql]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34259</uri>
			</author>
			<updated>2016-11-29T08:11:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109476#p109476</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109472#p109472" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>1. Gui, -DPIScale&nbsp; , - в описании хелпе нашел только примеры с этим параметром, но нет описания что это.</p></blockquote></div><p>В оффициальном <a href="https://autohotkey.com/docs/commands/Gui.htm#Options">есть</a>.</p><p>Остальные вопросы про массивы, <a href="http://ahkscript.org/docs/Objects.htm">ответы здесь</a>.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-11-28T15:44:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109472#p109472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109461#p109461" />
			<content type="html"><![CDATA[<p>То что я не понял:<br />1. Gui, -DPIScale&nbsp; , - в описании хелпе нашел только примеры с этим параметром, но нет описания что это.<br />2. Buttons1 := [&quot;TextKeys1&quot;,&quot;ButKeys1_1&quot;,&quot;ButKeys1_2&quot;] -в хелпе так же не нашел пример такого кода. Как я понял. Мы создаем переменную Buttons1 =, в скобках [ ], TextKeys1 не очень понятно что это, если это встроенная переменная, то в следующей кнопке так же было TextKeys1, но там уже TextKeys2, значит это что-то другое. Далее в скобках &quot;ButKeys1_1&quot;,&quot;ButKeys1_2&quot; это видимо сами кнопки, но так же не понятно, что мы в переменную Buttons1 помещаем. Сразу два и более названий кнопки ? </p><p>3. ShowHide := {Hide:Buttons%ButtonsShow%}, ButtonsShow := 0 , - тут я так же не нашел примера подобного кода в хелпе, тут видимо создаем переменную ShowHide и помещаем туда скрытую кнопку Buttons + номер кнопки берем из другого перебора,<br />ShowHide := {Show:Buttons1, Hide:Buttons2}, ButtonsShow := 1<br />или = 1 или 2, но кнопки у нас вроде имена другие имеют vButKeys1_1 вроде. В общем этот код совсем не понятен.</p><p>4. ShowHide := {Show:[&quot;Text2&quot;,&quot;Viborr2&quot;], Hide:[&quot;Text3&quot;,&quot;Viborr3&quot;]}&nbsp; , - тут такая же ситуация, непонятно что откуда берется. </p><p>5. 	</p><div class="codebox"><pre><code>for key, arr in ShowHide
		for i, var in arr
			GuiControl, %key%, %var% </code></pre></div><p>тут то же не очень пойму.</p>]]></content>
			<author>
				<name><![CDATA[itscan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33773</uri>
			</author>
			<updated>2016-11-28T07:18:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109461#p109461</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109448#p109448" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong> Был бы очень благодарен, если бы в коде немного поставили комментарии, мне многое в коде не понятно, был бы очень благодарен. Для меня пока что сложно разобраться, а тупо копировать без понимания не хочется. Да и другим думаю будет полезно.</p><div class="codebox"><pre><code>
#NoEnv 

Gui, -DPIScale
Gui, Add, Tab2, w400 h350, 1

Gui, Add, text, x+20 y+20 vText1, Текст 1
Gui, Add, DropDownList, xp w120 y+10 vSreda gSredaL1, Aa1|Aa2

Gui, Add, text, xp y+30 vText2 Hidden Section, Текст 2
Gui, Add, DropDownList, xp y+10 Hidden vViborr2 gVibor w250, a1|a2

Gui, Add, text, xs ys vText3 Hidden, Текст 3
Gui, Add, DropDownList, xp y+10 Hidden vViborr3 gVibor w250, a3|a4

Gui, Add, Text, Hidden vTextKeys1 Section xp y+30, Кнопки 1
Gui, Add, Button, xp y+10 Hidden vButKeys1_1, &amp;Кнопка1
Gui, Add, Button, xp y+10 Hidden vButKeys1_2, &amp;Кнопка1
Buttons1 := [&quot;TextKeys1&quot;,&quot;ButKeys1_1&quot;,&quot;ButKeys1_2&quot;]

Gui, Add, Text, xs ys Hidden vTextKeys2, Кнопки 2
Gui, Add, Button, xp y+10 Hidden vButKeys2_1, &amp;Кнопка2
Gui, Add, Button, xp y+10 Hidden vButKeys2_2, &amp;Кнопка2
Buttons2 := [&quot;TextKeys2&quot;,&quot;ButKeys2_1&quot;,&quot;ButKeys2_2&quot;]

Gui, Show, , текст 
Return

SredaL1:
	ShowHide := {Hide:Buttons%ButtonsShow%}, ButtonsShow := 0
	GoSub, Show_Hide
	GuiControl, Choose, Viborr2, 0
	GuiControl, Choose, Viborr3, 0
	
	GuiControlGet, %A_GuiControl%
	if Sreda = Aa1 
		ShowHide := {Show:[&quot;Text2&quot;,&quot;Viborr2&quot;], Hide:[&quot;Text3&quot;,&quot;Viborr3&quot;]}
	else if Sreda = Aa2
		ShowHide := {Hide:[&quot;Text2&quot;,&quot;Viborr2&quot;], Show:[&quot;Text3&quot;,&quot;Viborr3&quot;]}
	Goto, Show_Hide

Vibor:
	GuiControlGet, Control, , %A_GuiControl%   
	if Control in a1,a3 
		ShowHide := {Show:Buttons1, Hide:Buttons2}, ButtonsShow := 1
	if Control in a2,a4
		ShowHide := {Hide:Buttons1, Show:Buttons2}, ButtonsShow := 2
	Goto, Show_Hide 

Show_Hide:	 
	for key, arr in ShowHide
		for i, var in arr
			GuiControl, %key%, %var% 
	Return 
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[itscan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33773</uri>
			</author>
			<updated>2016-11-27T20:56:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109448#p109448</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109447#p109447" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong> Да, все то что нужно )) ваш код это то что я как раз хотел делать и разбираться, теперь будет проще <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br /><strong>ypppu</strong> и вам спасибо, добавил в код GUI, Submit, NoHide и так же заработало.<br /><strong>Oomniq</strong> И вам спасибо.</p><div class="codebox"><pre><code>
ViborL3:
GUI, Submit, NoHide
	if Viborr3 = a3
		Goto, 1
	if Viborr3 = a4
		Goto, 2
	Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[itscan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33773</uri>
			</author>
			<updated>2016-11-27T20:45:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109447#p109447</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109446#p109446" />
			<content type="html"><![CDATA[<p>Или так:</p><div class="codebox"><pre><code>#NoEnv 

Gui, -DPIScale
Gui, Add, Tab2, w400 h350, 1

Gui, Add, text, x+20 y+20 vText1, Текст 1
Gui, Add, DropDownList, xp w120 y+10 vSreda gSredaL1, Aa1|Aa2

Gui, Add, text, xp y+30 vText2 Hidden Section, Текст 2
Gui, Add, DropDownList, xp y+10 Hidden vViborr2 gVibor w250, a1|a2

Gui, Add, text, xs ys vText3 Hidden, Текст 3
Gui, Add, DropDownList, xp y+10 Hidden vViborr3 gVibor w250, a3|a4

Gui, Add, Text, Hidden vTextKeys1 Section xp y+30, Кнопки 1
Gui, Add, Button, xp y+10 Hidden vButKeys1_1, &amp;Кнопка1
Gui, Add, Button, xp y+10 Hidden vButKeys1_2, &amp;Кнопка1
Buttons1 := [&quot;TextKeys1&quot;,&quot;ButKeys1_1&quot;,&quot;ButKeys1_2&quot;]

Gui, Add, Text, xs ys Hidden vTextKeys2, Кнопки 2
Gui, Add, Button, xp y+10 Hidden vButKeys2_1, &amp;Кнопка2
Gui, Add, Button, xp y+10 Hidden vButKeys2_2, &amp;Кнопка2
Buttons2 := [&quot;TextKeys2&quot;,&quot;ButKeys2_1&quot;,&quot;ButKeys2_2&quot;]

Gui, Show, , текст 
Return

SredaL1:
	ShowHide := {Hide:Buttons%ButtonsShow%}, ButtonsShow := 0
	GoSub, Show_Hide
	GuiControl, Choose, Viborr2, 0
	GuiControl, Choose, Viborr3, 0
	
	GuiControlGet, %A_GuiControl%
	if Sreda = Aa1 
		ShowHide := {Show:[&quot;Text2&quot;,&quot;Viborr2&quot;], Hide:[&quot;Text3&quot;,&quot;Viborr3&quot;]}
	else if Sreda = Aa2
		ShowHide := {Hide:[&quot;Text2&quot;,&quot;Viborr2&quot;], Show:[&quot;Text3&quot;,&quot;Viborr3&quot;]}
	Goto, Show_Hide

Vibor:
	GuiControlGet, Control, , %A_GuiControl%   
	if Control in a1,a3 
		ShowHide := {Show:Buttons1, Hide:Buttons2}, ButtonsShow := 1
	if Control in a2,a4
		ShowHide := {Hide:Buttons1, Show:Buttons2}, ButtonsShow := 2
	Goto, Show_Hide 

Show_Hide:	 
	for key, arr in ShowHide
		for i, var in arr
			GuiControl, %key%, %var% 
	Return </code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-11-27T20:34:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109446#p109446</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109444#p109444" />
			<content type="html"><![CDATA[<p>Что-то вроде этого?<br /></p><div class="codebox"><pre><code>Gui, Add, Tab, w400 h550, 1
Gui, Add, text,vText1, Текст
Gui, Add, DropDownList, w120 vVSreda gSredaL1, 1|2
Gui, Show, autosize, текст
Gui, Add, text, Hidden x20 y80 vText2, Текст2
Gui, Add, DropDownList, Hidden x20 y100 Hidden vViborr2 gViborL2 w250, 1|2
Gui, Add, text, Hidden x20 y80 vText3, Текст3
Gui, Add, DropDownList, Hidden x20 y100 Hidden vViborr3 gViborL3 w250, 3|4
Gui, Add, Text, Hidden x20 y160 vtex1, 1
Gui, Add, Button, Hidden x20 y180 vbutton1 default, &amp;Кнопка
Gui, Add, Button, Hidden x80 y180 vbutton2, &amp;Кнопка
Gui, Add, Text, Hidden x20 y160 vtex2, 2
Gui, Add, Button, Hidden x20 y180 vbutton3 default, &amp;Кнопка
Gui, Add, Button, Hidden x80 y180 vbutton4, &amp;Кнопка
return

SredaL1:
GuiControlGet, vsreda
if VSreda = 1
	{
	GuiControl, Hide, Text3
	GuiControl, Hide, Viborr3
	GuiControl, Show, Text2
	GuiControl, Show, Viborr2
	gui, show, autosize
	}
if VSreda = 2
	{
	GuiControl, Hide, Text2
	GuiControl, Hide, Viborr2
	GuiControl, Show, Text3
	GuiControl, Show, Viborr3
	gui, show, autosize
	}
return

ViborL2:
GuiControlGet, Viborr2
if viborr2=1
goto, 1
if viborr2=2
goto, 2
Return
	
ViborL3:
GuiControlGet, Viborr3
if viborr3=3
goto, 1
if viborr3=4
goto, 2
Return

1:	
loop, 4
GuiControl, Hide, button%a_loopfield%
GuiControl, Hide, Tex2
GuiControl, Show, Tex1
GuiControl, Show, button1
GuiControl, Show, button2
Return

2:
loop, 4
GuiControl, Hide, button%a_loopfield%
GuiControl, Hide, Tex1
GuiControl, Show, Tex2
GuiControl, Show, button3
GuiControl, Show, button4
Return </code></pre></div>]]></content>
			<author>
				<name><![CDATA[Oomniq]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34229</uri>
			</author>
			<updated>2016-11-27T20:13:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109444#p109444</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109442#p109442" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>itscan пишет:</cite><blockquote><p>Я понимаю как оно работает. Я не понимаю где у меня ошибка.</p></blockquote></div><p>Вот теперь вроде поняли. Но забыли в начале подпрограмм <strong>ViborL2:</strong> и <strong>ViborL3:</strong> записать в переменные элементов GUI значения из ниспадающих списков. <br /></p><div class="codebox"><pre><code>GUI, Submit, NoHide</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-11-27T19:53:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109442#p109442</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109434#p109434" />
			<content type="html"><![CDATA[<p>Я понимаю как оно работает. Я не понимаю где у меня ошибка.<br />Переделал If по вашей схеме.</p><p>Пожалуйста запустите у себя, сделайте такие шаги.<br />Выбрать Аа1, далее текст а1, далее выбрать в 1 выпадалке Аа2, мы получаем заветные кнопки.<br />Но как видно мы их получили вообще не тогда когда нужно, причем если менять Аа1 на Аа2, то все время появляются кнопки. Я смотрю код, и не понимаю почему такое поведение.<br />В идеале должно было быть так:<br />Выбрать Аа1, далее текст а1, кнопки появились, если выбрать а2, то другие кнопки, но это я еще не сделал.</p><br /><div class="codebox"><pre><code>
Gui, Add, Tab, w400 h550, 1


Gui, Add, text,vText1, Текст
Gui, Add, DropDownList, w120 vSreda gSredaL1, Aa1|Aa2

Gui, Add, text, x20 y80 vText2, Текст
Gui, Add, DropDownList, x20 y100  vViborr2 gViborL2 w250, a1|a2

Gui, Add, text, x20 y80 vText3, Текст
Gui, Add, DropDownList, x20 y100  vViborr3 gViborL3 w250, a3|a4

GuiControl, Hide, Text2
GuiControl, Hide, Viborr2
GuiControl, Hide, Text3
GuiControl, Hide, Viborr3
Gui, Show, autosize, текст
;w400 h600

SredaL1:
gui, submit, nohide
if Sreda = Aa1
	{
	GuiControl, Hide, Text3
	GuiControl, Hide, Viborr3
	GuiControl, Show, Text2
	GuiControl, Show, Viborr2
	gui, show, autosize
	}

if Sreda = Aa2
	{
	GuiControl, Hide, Text2
	GuiControl, Hide, Viborr2
	GuiControl, Show, Text3
	GuiControl, Show, Viborr3
	gui, show, autosize
	}


ViborL2:
	if Viborr2 = a1
		Goto, 1
	if Viborr2 = a2
		Goto, 2
	Return
	
ViborL3:
	if Viborr3 = a3
		Goto, 1
	if Viborr3 = a4
		Goto, 2
	Return

1:	
Gui, Add, Text,, 1
Gui, Add, Button, default, &amp;Кнопка
Gui, Add, Button, default, &amp;Кнопка
Return

2:
Gui, Add, Text,, 2
Gui, Add, Button, default, &amp;Кнопка
Gui, Add, Button, default, &amp;Кнопка
Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[itscan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33773</uri>
			</author>
			<updated>2016-11-27T19:40:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109434#p109434</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109427#p109427" />
			<content type="html"><![CDATA[<p><span class="postimg"><img src="http://video460.vkadre.ru/assets/thumbnails/9485430594002210.320.vk.jpg" alt="http://video460.vkadre.ru/assets/thumbnails/9485430594002210.320.vk.jpg" /></span>&nbsp; <span class="postimg"><img src="http://abload.de/img/14582307312110l1ozw.jpg" alt="http://abload.de/img/14582307312110l1ozw.jpg" /></span></p><p>Короче говоря... Выбросите из головы весь скрипт.<br />Сначала разберитесь как взаимодействуют<br /></p><ul><li><p>ассоциированная переменная</p></li><li><p>метка перехода</p></li><li><p>встроенная переменная A_GuiControl</p></li></ul><div class="codebox"><pre><code>var = 1|2
GUI, Add, DropDownList, vMyList gMyLabel, %var%
GUI, Show
Return

MyLabel:
GUI, Submit, NoHide
MsgBox,
(
Эта подпрограмма запущена элементом управления,
с которым ассоциирована переменная %A_GuiControl%.
Эта пермененная содержит значение %MyList%.
)
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-11-27T19:25:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109427#p109427</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109425#p109425" />
			<content type="html"><![CDATA[<p>Посмотрел в хелпе, ничего там нет ценного.</p><div class="quotebox"><blockquote><p>A_GuiControl, содержащую текст или имя переменной элемента управления, получившего событие (если события получено не было, значения нет);</p></blockquote></div><p>Попробовал выводить переменную, и у меня получается какая то белиберда.<br /></p><div class="codebox"><pre><code>
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.




;--------------------Button---------------------------------------------------------
; Основные вкладки в табличной части
Gui, Add, Tab, w400 h550, 1


Gui, Add, text,vText1, Текст
Gui, Add, DropDownList, w120 vSreda gSredaL1, Aa1|Aa2

Gui, Add, text, x20 y80 vText2, Текст
Gui, Add, DropDownList, x20 y100 Hidden vViborr2 gViborL2 w250, a1|a2

Gui, Add, text, x20 y80 vText3, Текст
Gui, Add, DropDownList, x20 y100 Hidden vViborr3 gViborL3 w250, a3|a4

GuiControl, Hide, Text2
GuiControl, Hide, Viborr2
GuiControl, Hide, Text3
GuiControl, Hide, Viborr3
Gui, Show, autosize, текст
;w400 h600

SredaL1:
gui, submit, nohide
if Sreda = Aa1
	{
	GuiControl, Hide, Text3
	GuiControl, Hide, Viborr3
	GuiControl, Show, Text2
	GuiControl, Show, Viborr2
	gui, show, autosize
	}

if Sreda = Aa2
	{
	GuiControl, Hide, Text2
	GuiControl, Hide, Viborr2
	GuiControl, Show, Text3
	GuiControl, Show, Viborr3
	gui, show, autosize
	}


ViborL2:
	MsgBox, контрол %A_GuiControl%
	MsgBox, выбор %Viborr2%
	if A_GuiControl = a1
		Goto, 1
	if A_GuiControl = a2
		Goto, 2
	Return
	
ViborL3:
	if A_GuiControl = 1
		Goto, 1
	if A_GuiControl = 2
		Goto, 2
	Return

1:	
Gui, Add, Text,, 1
Gui, Add, Button, default, &amp;Кнопка
Gui, Add, Button, default, &amp;Кнопка
Return

2:
Gui, Add, Text,, 2
Gui, Add, Button, default, &amp;Кнопка
Gui, Add, Button, default, &amp;Кнопка
Return

</code></pre></div><p>Добавил вывод переменных 2х.<br />У меня вопрос возник. Почему если я эти переменные засунул в ViborL2:, и как я понимаю они должны отработать, только когда дойдет до них очередь.<br />Но при запуске скрипта, они уже выполняются, и при каждом шаге до того момента когда они реально должны сработать, они в каждом шаге отрабатывают.</p><p>При этом %A_GuiControl% получает только сам Viborr2, без реального выбора 1 или 2.<br />Если сам %Viborr2% смотреть, то в тот момент когда он должен получить 1 или 2. Он вообще ничего не получает.<br />Но если переключать самую 1 вкладку туда сюда, в какой то момент %Viborr2% получает значение а2, и так с ним и остается.</p><p>Кто разбирается, в чем у меня ошибка. Почему так ведет себя программа ?<br />Буду рад помощи. Я уже вообще не понимаю почему так себя ведет.</p><p>-----------------------<br />Вообще какая у меня цель:<br />Из 1 выпадашки выбрать 1 из 10 пунктов. допустим выбрали 5<br />Из 2 выпадашки фильтруем выбор 5 и выводим еще одну выпадашку 1 из 5, допустим выбрали 2<br />После выбора 2, у меня отображаются допустим кнопки, при нажатии на которые что то будет делаться, но это уже другое.</p><p>1 шаг вроде сделан.<br />2 шаг вроде сделан.<br />на 3 шаге у меня проблема с переменными.</p><p>Я честно не втыкаю что я не так делаю. <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[itscan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33773</uri>
			</author>
			<updated>2016-11-27T18:55:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109425#p109425</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109423#p109423" />
			<content type="html"><![CDATA[<p>Так мне же надо конкретный выбор то )) если 1 то одно, если 2 то другое. А так условие всегда верно.<br />В &quot;Viborr2&quot; попадает выбор человека с выпадалки, там в итоге будет штук 10 вариантов.</p>]]></content>
			<author>
				<name><![CDATA[itscan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33773</uri>
			</author>
			<updated>2016-11-27T18:37:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109423#p109423</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109422#p109422" />
			<content type="html"><![CDATA[<p>У меня в подписи ссылки на документацию.</p><p>А чтобы кнопки показались, нужно<br /></p><div class="codebox"><pre><code>If A_GuiControl = &quot;Viborr2&quot;</code></pre></div><p>как-то так.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-11-27T18:15:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109422#p109422</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109421#p109421" />
			<content type="html"><![CDATA[<p>А где можно прочитать тогда? Как мне сделать, чтобы все же показались кнопки.</p>]]></content>
			<author>
				<name><![CDATA[itscan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33773</uri>
			</author>
			<updated>2016-11-27T18:09:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109421#p109421</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с DropDownList (не решено)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109420#p109420" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Это я написал пример что я так пробовал и так же не работает.</p></blockquote></div><p> <br /></p><div class="quotebox"><blockquote><p>Этим кодом я проверяю что он выбрал.</p></blockquote></div><p>Неправильно. Я написал уже дважды, что A_GuiControl никогда не будет равен 1 (или 2 или 3 или 4). Читайте описание этой встроенной переменной внимательно.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-11-27T18:02:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109420#p109420</id>
		</entry>
</feed>
