Get label height for multiline label on Android


does somebody know a way to get / calculate the height for a multiline label so I could rearrange the controls below the label?

Thanks alot.

Best regards

Why not using a temporary Picture, set the Picture.Graphics.Font to the Label.TextFont and then call Picture.Graphics.TextHeight?

Great idea. But how could I use the users Android theme settings for font? Does the Label.TextFont provide that?

Var oFont As Font = Font.SystemFont(Font.SystemFontSize)

Label1.TextFont = oFont

Var oPic As New Picture(Label1.Width, 1)
Var g As Graphics = oPic.Graphics

g.Font = oFont

Var dHeight As Double = g.TextHeight(Label1.Text, g.Width)
1 Like

Thank you very much