<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Переключатель с помощью Button]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13699&amp;type=atom" />
	<updated>2018-05-10T17:05:40Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13699</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переключатель с помощью Button]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125285#p125285" />
			<content type="html"><![CDATA[<p>Еще нашел одно решение по своему вопросу.</p><div class="codebox"><pre><code>Gui, Add, Button, w100 h100, Start
Gui, Show, w200 h200, Test
Return

ButtonStart:
GuiControlGet, OutputVar,, Button1
If OutputVar = Start
  GuiControl, Text, Button1, Stop
Else
  GuiControl, Text, Button1, Start
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2018-05-10T17:05:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125285#p125285</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переключатель с помощью Button]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125280#p125280" />
			<content type="html"><![CDATA[<p>То, что нужно. Спасибо огромное.</p>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2018-05-10T14:54:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125280#p125280</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переключатель с помощью Button]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125278#p125278" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
singleinstance, force
btnlbl := 0                                ;starts in off position; change to 1 to start in on position
gui, add, button, gtest vtest, % btnlbl?&quot;on&quot;:&quot;off&quot;
gui,show, w200 h200
return

test:
btnlbl := !btnlbl
guicontrol, ,test, % btnlbl?&quot;on&quot;:&quot;off&quot;
if btnlbl
	msgbox Do &quot;on&quot; Stuff
else
	msgbox Do &quot;off&quot; Stuff
return
</code></pre></div><p><a href="https://autohotkey.com/board/topic/107603-gui-button-working-as-toggle/">https://autohotkey.com/board/topic/1076 … as-toggle/</a></p>]]></content>
			<author>
				<name><![CDATA[red2881]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30934</uri>
			</author>
			<updated>2018-05-10T14:50:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125278#p125278</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переключатель с помощью Button]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125276#p125276" />
			<content type="html"><![CDATA[<p>Спасибо, что ответили <strong>red2881</strong>, но я спрашивал про саму конструкцию в Gui как это реализовать. Чтоб была только одна кнопка с начальной позицией СТАРТ и при нажатии на нее была кнопка с надписью СТОП.</p>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2018-05-10T14:40:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125276#p125276</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переключатель с помощью Button]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125275#p125275" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=8541"> AHK: Включение/выключение цикла на одну кнопку.</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=1205"> AHK: Многодельность клавиши</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=8062"> AHK: два действия на одну клавишу</a></p>]]></content>
			<author>
				<name><![CDATA[red2881]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30934</uri>
			</author>
			<updated>2018-05-10T14:32:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125275#p125275</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Переключатель с помощью Button]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125274#p125274" />
			<content type="html"><![CDATA[<p>Всем доброго времени суток. Поправьте меня, если неправильно назвал тему.<br />Можно сделать, чтоб управлялось одной кнопкой?</p><p>Составил скрипт, чтоб Вы поняли, чего именно я хочу добиться.</p><div class="codebox"><pre><code>Start = Старт
Stop = Остановлен
Disabled1 =
Disabled2 = +Disabled
restart:
Gui Add, Button, x39 y68 w80 h61 %Disabled1% gButton1, %Start%
Gui Add, Button, x150 y68 w80 h61 %Disabled2% gButton2, %Stop%
Gui Show, w270 h191, Window
Return 

Button1:
Start = Запущен
Stop = Стоп
Disabled1 = +Disabled
Disabled2 =
Gui, Destroy
Goto, restart
return

Button2:
Start = Старт
Stop = Остановлен
Disabled1 =
Disabled2 = +Disabled
Gui, Destroy
Goto, restart
return

GuiEscape:
GuiClose:
    ExitApp</code></pre></div><p>Сейчас две кнопки. Но как сделать, чтоб все это управлялось одной? Ну и соответственно со сменой текста внутри кнопки.<br />Читал справку по GuiControlGet и если я правильно понял, это тут не сработает.</p>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2018-05-10T13:59:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125274#p125274</id>
		</entry>
</feed>
