[Gambas-user] Label control

gian bagoneo at libero.it
Thu Jun 16 16:24:48 CEST 2022


Il 16/06/22 16:08, gian via User ha scritto:
> Il 15/06/22 14:52, gian via User ha scritto:
>> Il 15/06/22 00:26, Steve via User ha scritto:
>>> I am attempting to populate a label control. The text on the control 
>>> will vary. The size of the control does not. Is there a way to detect 
>>> when the text Will overflow the control so that I can split the text 
>>> up properly to display? This would be in the case where there is 
>>> sufficient vertical room but not horizontal. Also the font size will 
>>> vary.
>>
>> The TextLabel has Autoresize and Wrap properties that, if i undestand, 
>> you should need.
>> Why can't you use them?
>>
>> Regards
>> Gianluigi
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 
> OK, I didn't understand :-)
> 
> Then try this code in a new graphic project:
> 
> '-------------------------------------------------------------------
> Public Sub Form_Open()
> 
>    Dim s As String = "Lorem ipsum dolor sit amet, consectetur 
> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore 
> magna aliqua."
>    Dim iRows, iHeight, iNew As Integer
>    Dim iFontHeight As Integer
>    Dim fProp As Float
>    Dim hFont As Font
>    Dim hTextLabel As TextLabel
> ...

Hi,

don't mind the variables iHeight, iNew, iFontHeight, fProp, I only do 
the cleaning on Saturdays.

Regads
Gianluigi



More information about the User mailing list