Hello all, i need some advice on how to set the internal height of a scrollview so that it adjusts to the height of the text being displayed, i tried scrollview.panel.height but it doesn't seem to work, can anyone please tell me what i'm doing wrong, i have a label and i'm displaying data being pulled from a database file, the text varies in height, i'm using the .MeasureMultilineTextHeight method to measure the height of the label, but i can not seem to make the height of the scrollview adjust to the height of the text.
Please help.
here's part of the my code
thanks everyone!!!!!
Sub NextButton_Click
Dim qq As Int
Dim lblheight1 As Int
Counter = Counter + 1
If Counter > 99 Then Counter = 99 'The sample database has 4 records
DetailLabel.Text = RecordsList.Get(Counter)
If AnswerList.Get(Counter) = Null Then
Label1.Text = "Empty Answer"
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.Text = "Empty Answer"
ScrollView1.Panel.Height = lblheight1 + 800dip
Else
Label1.text = AnswerList.Get(Counter)
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.text = AnswerList.Get(Counter)
ScrollView1.Panel.Height = lblheight1 + 800dip
End If
If AnswerList.Get(Counter) = Null AND Counter = 43 Then
Label1.Text = StateModule.CapitalName
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.Text = StateModule.CapitalName
ScrollView1.Panel.Height = lblheight1 + 800dip
Else If AnswerList.Get(Counter) = Null AND Counter = 22 Then
Label1.Text = StateModule.RepNames
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.Text = StateModule.RepNames
ScrollView1.Panel.Height = lblheight1 + 800dip
End If
End Sub
Please help.
here's part of the my code
thanks everyone!!!!!
Sub NextButton_Click
Dim qq As Int
Dim lblheight1 As Int
Counter = Counter + 1
If Counter > 99 Then Counter = 99 'The sample database has 4 records
DetailLabel.Text = RecordsList.Get(Counter)
If AnswerList.Get(Counter) = Null Then
Label1.Text = "Empty Answer"
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.Text = "Empty Answer"
ScrollView1.Panel.Height = lblheight1 + 800dip
Else
Label1.text = AnswerList.Get(Counter)
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.text = AnswerList.Get(Counter)
ScrollView1.Panel.Height = lblheight1 + 800dip
End If
If AnswerList.Get(Counter) = Null AND Counter = 43 Then
Label1.Text = StateModule.CapitalName
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.Text = StateModule.CapitalName
ScrollView1.Panel.Height = lblheight1 + 800dip
Else If AnswerList.Get(Counter) = Null AND Counter = 22 Then
Label1.Text = StateModule.RepNames
lblheight1 = lblheight.MeasureMultilineTextHeight(Label1, Label1.Text)
Label1.Height = lblheight1
Label1.Text = StateModule.RepNames
ScrollView1.Panel.Height = lblheight1 + 800dip
End If
End Sub