Page 1 of 1

GuiControl - Change color and size

Posted: 06 Apr 2020, 15:17
by Albireo
Hello!
I'm having trouble changing the color and size of the text in a field.

Wrote a small test program that creates a text field in red.
If the Next button is pressed, the text field should get green text.

Code: Select all

#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.
#SingleInstance force


; GUI window
	Gui 2: Font, cRed s14 Normal, Verdana
	Gui 2: Add, Text, x20 y30 w260 h25 +Center vResult2, Some Message
	Gui 2: Add, Button, x100 y70 h40 w100 center vButtOK gNewMess, Next!
	
	Gui 2: Show, x40 y100 h150 w300, GUI Test
Return			
	

NewMess:
	Gui 2: Font, s12 cGreen Bold, Verdana  ; If desired, use a line like this to set a new default font for the window.
	GuiControl 2:, Font, Result2
	GuiControl 2:, Result2, Correct button!
Return

GuiClose:
	*Esc::
	ExitApp
Return
But How?

Re: GuiControl - Change color and size

Posted: 06 Apr 2020, 15:36
by BNOLI

Re: GuiControl - Change color and size  Topic is solved

Posted: 06 Apr 2020, 15:39
by boiler
You have an extra comma in your GuiControl Font line. Should be:

Code: Select all

GuiControl 2:Font, Result2

Re: GuiControl - Change color and size

Posted: 06 Apr 2020, 18:10
by Albireo
Thanks! :bravo: