Page 1 of 1

Gui Add Text control not responding to height setting

Posted: 24 Aug 2020, 11:50
by elmo
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 360 times
Is it possible to override the enforced default height ?

Thanks.

Re: Gui Add Text control not responding to height setting

Posted: 24 Aug 2020, 13:00
by BoBo

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:

Re: Gui Add Text control not responding to height setting

Posted: 24 Aug 2020, 13:40
by elmo
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.

Re: Gui Add Text control not responding to height setting

Posted: 24 Aug 2020, 14:09
by boiler
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

Re: Gui Add Text control not responding to height setting

Posted: 24 Aug 2020, 14:22
by elmo
@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.