Hello,
I use this code for adjust fontsize of label
How replace DoEvents ?
Thanks
I use this code for adjust fontsize of label
B4X:
Sub sizeH(txt As String, fontsize As Float) as int
'calcule la hauteur d'un texte
Dim h As Int
Dim r As Reflector
Dim lblTest1 As Label
lblTest1.Initialize("")
lblTest1.Color=Colors.Transparent
lblTest1.TextColor=Colors.Transparent
lblTest1.Text=txt
r.Target=lblTest1
Activity.AddView(lblTest1,0,0,-2,-2)
lblTest1.TextSize=fontsize
DoEvents ' needed to update the properties
'w=r.RunMethod("getWidth")
h=r.RunMethod("getHeight")
Log("sizeH="&h)
lblTest1.RemoveView
Return h
End Sub
How replace DoEvents ?
Thanks
Last edited: