Sub InitEditPanel
' Adds the Label and EditText views onto the ScrollView panel by code
Dim lbl(Main.ColNumber) As Label
Dim edt(Main.ColNumber) As EditText
Dim Height = 50dip As Int
Dim VSpace = Height + 10dip As Int
Dim lblLeft = 10dip As Int
Dim lblWidth = 30%x - 10dip As Int
Dim edtLeft = 30%x + 10dip As Int
Dim edtWidth = 70%x - 20dip As Int
Dim i As Int
For i = 0 To Main.ColNumber - 1
lbl(i).Initialize("")
scvEdit.Panel.AddView(lbl(i), lblLeft, 10dip + i * VSpace, lblWidth, Height)
lbl(i).Tag = i
lbl(i).Gravity = Bit.OR(Gravity.RIGHT, Gravity.CENTER_VERTICAL)
lbl(i).TextSize = 16
lbl(i).Text = Main.ColAliasNames(i)
lbl(i).TextColor = Colors.Yellow
edt(i).Initialize("edt")
scvEdit.Panel.AddView(edt(i), edtLeft, 10dip + i * VSpace, edtWidth, Height)
edt(i).Tag = i
edt(i).TextColor = Colors.Black
Next
edt(0).Enabled = False
scvEdit.Panel.Height = 10dip + i * VSpace
End Sub