How can I customize the Colors/Theme of the entire GUI?
I'm a little stuck with this.
How to customize the Color/Theme of the GUI?
-
- Posts: 28
- Joined: 15 Sep 2020, 03:51
- Location: Germany
- Contact:
-
- Posts: 28
- Joined: 15 Sep 2020, 03:51
- Location: Germany
- Contact:
Re: How to customize the Color/Theme of the GUI?
Is there a Function/Script that allows us to customize the Theme?
Re: How to customize the Color/Theme of the GUI?
Hallo,
I had once played around with a script from jNizM.
Maybe helpful?:
I had once played around with a script from jNizM.
Maybe helpful?:
Code: Select all
#Requires AutoHotkey v2.0
;based on jNizM https://www.autohotkey.com/boards/viewtopic.php?p=303131#p303131
MyGui := Gui(, "Test")
MyGui.BackColor := 000000
hTx1 := MyGui.Add("Text", "BackgroundCFD8DC", "Edit Control:")
hTx1.SetFont("c263238")
hEdt1 := MyGui.Add("Edit", "w400 r5 BackgroundE1BEE7", "Edit 1`nEdit 2`nEdit 3")
hEdt1.SetFont("c4A148C")
hEdt2 := MyGui.Add("Edit", "w400 r5", "Edit 1`nEdit 2`nEdit 3")
hEdt2.SetFont("c0000FF")
hEdt2.Opt("Background00FFFF")
MyGui.Add("Text", "BackgroundCFD8DC", "ComboBox Control:").SetFont("c263238")
MyGui.Add("Combobox", "w400 BackgroundBBDEFB", ["Combo 1||Combo 2|Combo 3|Combo 4"]).SetFont("c0D47A1")
MyGui.Add("Text", "BackgroundCFD8DC", "ListBox Control:").SetFont("c263238")
MyGui.Add("ListBox", "w400 r4 BackgroundB2DFDB", ["ListBox 1||ListBox 2|ListBox 3|ListBox 4"]).SetFont("c004D40")
MyGui.Add("Text", "BackgroundCFD8DC", "DropDownList Control:").SetFont("c263238")
MyGui.Add("DropDownList", "w400 r4 BackgroundF0F4C3", ["DropDownList 1||DropDownList 2|DropDownList 3|DropDownList 4"]).SetFont("c827717")
MyGui.Add("Text", "BackgroundCFD8DC", "DropDownList Control (default):").SetFont("c263238")
MyGui.Add("DropDownList", "w400 r4", ["DropDownList 1||DropDownList 2|DropDownList 3|DropDownList 4"]).SetFont("c827717")
MyGui.Add("Text", "BackgroundCFD8DC", "ListView Control:").SetFont("c263238")
;MyGui.SetFont("cE65100") ; works like the cXXXXXX option for LV
LV := MyGui.Add("ListView", "w400 r10 BackgroundFFE0B2 cE65100", ["Col 1|Col 2|Col 3"]) ; .SetFont("") is not possible here
loop 5
LV.Add(, A_Index, A_Index * 2, A_Index * 3)
MyGui.Add("Button",, "Change Color").OnEvent("Click", ChangeCtlColors) ; there is a white border around Buttons? Possible workaround -> WM_CTLCOLORBTN()
MyGui.OnEvent("Close", DeleteObjects)
MyGui.Show()
ChangeCtlColors(this, *)
{
global hEdt2 ; does I really need a global here to act with gui controls?
hEdt2.Opt("BackgroundE7BEE1")
hEdt2.SetFont("cFF0000")
}
DeleteObjects(this, *)
{
if IsSet(hBrush)
DllCall("gdi32\DeleteObject", "ptr", hBrush)
}
WM_CTLCOLORBTN(*) ; this should be a build-in default for Button-Borders
{
global hBrush
static init := OnMessage(0x0135, "WM_CTLCOLORBTN")
return hBrush := DllCall("gdi32\CreateSolidBrush", "uint", 0x000000, "uptr")
}
-
- Posts: 28
- Joined: 15 Sep 2020, 03:51
- Location: Germany
- Contact:
Re: How to customize the Color/Theme of the GUI?
That's dark mode, some controls don't support it. Check out Rohwedder's post.