fbritop Well-Known Member Licensed User Longtime User May 18, 2021 #1 Is there a way to calculate the height of the produced text of a BBLabel (understanding that the with of the outer panel is fixed)? When I produce a BBLabel, y cannot setup the correct height (and the labels that go below them) because I cannot find a way to calculate height. I´m looking to BBLabel as in order tu use int in B4I and B4A without much code change Thanks FBP
Is there a way to calculate the height of the produced text of a BBLabel (understanding that the with of the outer panel is fixed)? When I produce a BBLabel, y cannot setup the correct height (and the labels that go below them) because I cannot find a way to calculate height. I´m looking to BBLabel as in order tu use int in B4I and B4A without much code change Thanks FBP
Erel B4X founder Staff member Licensed User Longtime User May 19, 2021 #2 Code: Copy Dim TextHeight As Int = BBLabel1.Paragraph.Height / TextEngine.mScale + BBLabel1.Padding.Top + BBLabel1.Padding.Bottom BBLabel1.mBase.Height = TextHeight Note that in B4i and B4J, the "handle resize event" property of the relevant layout file should be unchecked. Upvote 0
Code: Copy Dim TextHeight As Int = BBLabel1.Paragraph.Height / TextEngine.mScale + BBLabel1.Padding.Top + BBLabel1.Padding.Bottom BBLabel1.mBase.Height = TextHeight Note that in B4i and B4J, the "handle resize event" property of the relevant layout file should be unchecked.