Gui Add Text control not responding to height setting

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
elmo
Posts: 113
Joined: 09 Oct 2013, 09:08

Gui Add Text control not responding to height setting

24 Aug 2020, 11:50

Greetings all,

I was hoping to reduce the height of a gui text control; however, it seems not to go below some pre-determined default value.

Code: Select all

Gui , 1:Add , Text , xm ym h2 Border , Height Test
Gui , 1:Show
As shown in the example below, the "h2" (height=2 pixels) parameter is completely ignored.
x-height-test.PNG
x-height-test.PNG (1.63 KiB) Viewed 354 times
Is it possible to override the enforced default height ?

Thanks.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Gui Add Text control not responding to height setting

24 Aug 2020, 13:00

Code: Select all

Gui, Font, s4
Gui , 1:Add , Text , xm ym w160 h8 Border , Height Test
Gui , 1:Show,,% chr(32)
Return
How to shrink a box if its content isn't shrunk as well? :wtf:
elmo
Posts: 113
Joined: 09 Oct 2013, 09:08

Re: Gui Add Text control not responding to height setting

24 Aug 2020, 13:40

Yes, precisely that, to shrink the box independently of the contents. Thank you for clarifying.

Or perhaps, is it possible to reduce the padding above and below; especially the white space above the text ?

The objective is to maximize the amount of information on a particular screen so the 'tighter' the box to the text, the better.
User avatar
boiler
Posts: 17141
Joined: 21 Dec 2014, 02:44

Re: Gui Add Text control not responding to height setting

24 Aug 2020, 14:09

If your goal is to just pack in lines of text tightly, then don't worry about the virtual box around it (and don't use a border) and position the text as tightly as you'd like:

Code: Select all

Gui, Add, Text, BackgroundTrans, First line
Gui, Add, Text, xp yp+9 BackgroundTrans, Second line
Gui, Show
elmo
Posts: 113
Joined: 09 Oct 2013, 09:08

Re: Gui Add Text control not responding to height setting

24 Aug 2020, 14:22

@boiler.

This is a most excellent suggestion and I would use it excepting that the border is mandatory to guide selection of the text by mouse.

Hmmm. The real challenge is to minimize the top white margin within the box; ideally to a single pixel.

I am familiar with 0x200 to set text to the middle vertically; is there a similar code to go to the top ?

In the end it simply may not possible and I greatly appreciate the ideas.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AlFlo, RussF and 117 guests