Sub SetText
Dim ht As Float
lblText.Text = txt ' set the text string to the Label text property
ht = StrUtil.MeasureMultilineTextHeight(lblText, txt) ' measure Label height
scvText.Panel.Height = ht ' set the ScrollView internal Panel height to the measured height
lblText.Height = ht ' set the Label height to the measured height
scvText.ScrollPosition = 0 ' set the scroll position to the top of the text
DoEvents ' needed to execute the previous line
End Sub