How to trim the GroupBox title?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
m3user
Posts: 235
Joined: 17 Jan 2014, 18:11

How to trim the GroupBox title?

Post by m3user » 23 Jan 2024, 16:20

The title of my GroupBox control changes dynamically. Any idea how to trim the title to not exceed the control's width?

Code: Select all

Gui, Add, GroupBox, w120, How to trim this GroupBox title?
Gui, Show
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: How to trim the GroupBox title?

Post by mikeyww » 23 Jan 2024, 17:53

Hello,

Some scripts are posted to compute width based on font and font size, so that might be one way. Another way could be to use ControlGetPos to measure (determine) the width before and after adding the text. You would then know whether the text needs to be shortened.
Post Reply

Return to “Ask for Help (v1)”