Setting the font size dynamically

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Billykid
Posts: 94
Joined: 16 Sep 2019, 08:59

Setting the font size dynamically

Post by Billykid » 28 Nov 2021, 08:58

Hello guys,

Code: Select all

; Setting the font size at program start:
FontSize := 12
Gui Font, S%FontSize% Bold 
.
-
Gui Add, Edit, xP y+5 w1900 h700 vEdit, This forum is nice!
.
.
Gui,Show, x10 y10
Is it possible to change the font size in an edit control by means of a function during runtime?
If so, how can this be done? Many thanks in advance.

User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: Setting the font size dynamically

Post by mikeyww » 28 Nov 2021, 09:24

Code: Select all

FontSize := 12
Gui, Font, s%FontSize% Bold
Gui, Add, Edit, w900 h500 vEdit, This forum is nice!
Gui, Add, Button, Hidden, OK
GuiControl, Focus, OK
Gui, Show
Sleep, 1000
font("Edit", 8)
Sleep, 1000
font("Edit", 28, "Red", BOLD := 700, "Arial")
Return

font(control, size, color := "Black" , weight := 400, face := "Verdana") {
 ; https://www.autohotkey.com/boards/viewtopic.php?p=431754#p431754
 Gui, Font, s%size% c%color% w%weight%, %face%
 GuiControl, Font, %control%
}

Post Reply

Return to “Ask for Help (v1)”