GuiControl - Change color and size Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Albireo
Posts: 1756
Joined: 16 Oct 2013, 13:53

GuiControl - Change color and size

06 Apr 2020, 15:17

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?
BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: GuiControl - Change color and size

06 Apr 2020, 15:36

Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !
User avatar
boiler
Posts: 17043
Joined: 21 Dec 2014, 02:44

Re: GuiControl - Change color and size  Topic is solved

06 Apr 2020, 15:39

You have an extra comma in your GuiControl Font line. Should be:

Code: Select all

GuiControl 2:Font, Result2

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], hiahkforum and 412 guests