I am attempting to decipher Klauses excellant code. I want to be able to vertically scroll an edittext inside a scrollview. It works great on a existing file as you can get the length on entry. My question is how would this be accomplished on a new empty file, so that as you entered text you could fast scroll as the edittext.text got longer. I'm uncertain how the DoEvents is handeling this. Thanks
Doog
Heres Klauses Code
Doog
Heres Klauses Code
B4X:
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