<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Как значение опции сделать зависящим от переменной]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13379&amp;type=atom" />
	<updated>2018-01-16T20:52:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13379</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123131#p123131" />
			<content type="html"><![CDATA[<p>Вот что получилось:<br /></p><div class="codebox"><pre><code>Gui, Add, Text, w100 vSt,
Gui, Show, h500 w500, MyWindow

q::
{
sost:=22
Guicontrol,1:,St, %sost%
Gui, font, cRed
GuiControl,Font, St
}
return

W::
{
sost:=33
Guicontrol,1:,St, %sost%
Gui, font, cBlue
GuiControl,Font, St
}
return

Guiclose:
ExitApp</code></pre></div><p>Спасибо большое, что объяснили, всё работает!</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T20:52:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123131#p123131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123130#p123130" />
			<content type="html"><![CDATA[<p>В начале ей вообще никакого значения присваивать не нужно. Если хотите установить какой-то цвет текста кроме чёрного изначально, <em>Gui, Font</em> использовать не нужно, для этого можно просто воспользоваться опцией &quot;c&quot;:<br /></p><div class="codebox"><pre><code>Gui, Add, Text, cRed w100 vSt, My Text
Gui, Show</code></pre></div><p>А вот чтобы поменять цвет, команда <em>Gui, Font</em> понадобится:<br /></p><div class="codebox"><pre><code>Gui, Add, Text, cRed w100 vSt, My Text
Gui, Show

Sleep, 1000

Gui, Font, cBlue
GuiControl, Font, St</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-01-16T20:40:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123130#p123130</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123129#p123129" />
			<content type="html"><![CDATA[<p>Так и когда только скрипт запущен текста тоже нет, пока я кнопку не нажми. Если вы про это хотите сказать. Я просто не понимаю, что переменной мешает&nbsp; замениться?</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T20:40:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123129#p123129</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123128#p123128" />
			<content type="html"><![CDATA[<p>Как тогда быть? Занулить её в начале?</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T20:34:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123128#p123128</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123127#p123127" />
			<content type="html"><![CDATA[<p>Ну так это же при нажатии присваивается, а когда скрипт только запущен, нажатия ещё не было, и эта переменная пустая.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-01-16T20:33:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123127#p123127</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123126#p123126" />
			<content type="html"><![CDATA[<p>Но им присваивается значение, при нажатии, и при каждом последующим значение меняется</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T20:30:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123126#p123126</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123125#p123125" />
			<content type="html"><![CDATA[<p>Да это не мне не нравится, это AHK-интерпретатору не нравится. Теперь непонятно:</p><div class="quotebox"><cite>Gutalin пишет:</cite><blockquote><div class="codebox"><pre><code>If St = 22
Gui, font, cRed
Else if St = 33 
Gui, font, cBlue
Gui, Add, Text, w100 vSt,</code></pre></div></blockquote></div><p>Здесь переменной <em>St</em> изначально не присвоено никакого значения, она пустая, соответственно строчки </p><div class="codebox"><pre><code>Gui, font, cRed</code></pre></div><p> и </p><div class="codebox"><pre><code>Gui, font, cBlue</code></pre></div><p>никогда не выполнятся. Кроме того, <em>St</em> — это у Вас переменная, ассоциированная с контролом, такие переменные используются только для идентификации контрола и для получения его содержания, им присваивать какие-либо значения не принято.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-01-16T20:28:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123125#p123125</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123124#p123124" />
			<content type="html"><![CDATA[<p>Если Вам не нравится, что я использовал переменную, вот:<br /></p><div class="codebox"><pre><code>
If St = 22
Gui, font, cRed
Else if St = 33 
Gui, font, cBlue
Gui, Add, Text, w100 vSt,
Gui, Show, h500 w500, MyWindow
Gui, font, cDefault

q::
{
sost:=22
Guicontrol,1:,St, %sost%
}
return

W::
{
sost:=33
Guicontrol,1:,St, %sost%
}
return

Guiclose:
ExitApp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T20:14:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123124#p123124</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123123#p123123" />
			<content type="html"><![CDATA[<p>Такого синтаксиса тоже нет. Как поменять цвет, написано по ссылке, которую я дал.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-01-16T18:36:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123123#p123123</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123122#p123122" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br /></p><div class="quotebox"><blockquote><p>Guicontrol,1:,Cl, %Color%</p></blockquote></div><p>А это тогда что? Или я Вас не понимаю?</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T18:30:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123122#p123122</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123121#p123121" />
			<content type="html"><![CDATA[<p>Такого синтаксиса нет. У этой команды в опциях нет переменой, которая задаётся через v.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-01-16T18:27:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123121#p123121</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123120#p123120" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, это переменная. Нажимая, например, q я хочу дать ей значение cRed,&nbsp; и текст снизу чтобы стал красным, а уже нажимая W, я хочу дать ей значение cBlue, чтобы текст снизу стал синим.</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T18:25:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123120#p123120</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123119#p123119" />
			<content type="html"><![CDATA[<p>А что такое vCl?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-01-16T18:20:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123119#p123119</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123118#p123118" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, она задаёт цвет тексту</p>]]></content>
			<author>
				<name><![CDATA[Gutalin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39002</uri>
			</author>
			<updated>2018-01-16T18:20:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123118#p123118</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как значение опции сделать зависящим от переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=123117#p123117" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Gutalin пишет:</cite><blockquote><div class="codebox"><pre><code>Gui, font, vCl</code></pre></div></blockquote></div><p>А что эта строчка означает? Читайте <a href="https://autohotkey.com/docs/commands/Gui.htm#Font">Gui, Font</a> и <a href="https://autohotkey.com/docs/commands/GuiControl.htm#Font">GuiControl, Font</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-01-16T18:18:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=123117#p123117</id>
		</entry>
</feed>
