For i = 0 To Cursor.RowCount -1
Dim Height, Height2 As Float
Dim lblAgnDatum, lblAgnVak,lblAgnId As Label
Dim datumveld As String
Dim imgAgnDelete As ImageView
lblAgnDatum.Initialize("")
lblAgnVak.Initialize("")
lblAgnId.Initialize("")
imgAgnDelete.Initialize("")
imgAgnDelete.Bitmap = LoadBitmap(File.DirAssets,"delete.png")
Agendaoverzicht.Panel.Height=Agendaoverzicht.Height
Agendaoverzicht.Panel.Color = Colors.Transparent
Cursor.Position = i
datumveld=DateTime.Date(Cursor.GetLong("datum"))
lblAgnDatum.Text=datumveld
lblAgnVak.Text=Cursor.GetString("vak")
lblAgnId.Text=Cursor.GetInt("id")
imgAgnDelete.Tag = Cursor.GetInt("id")
Agendaoverzicht.Panel.AddView(lblAgnDatum, 5dip, 5dip + TotalHeight, Agendaoverzicht.Width, -2)
Agendaoverzicht.Panel.AddView(lblAgnVak, 5dip, 25dip + TotalHeight, Agendaoverzicht.Width, -2)
Agendaoverzicht.Panel.AddView(imgAgnDelete, 250dip, 8dip + TotalHeight, 20, 20)
DoEvents
Reflect.Target=lblAgnDatum
Height=Reflect.RunMethod("getHeight")
DoEvents
Reflect.Target=lblAgnVak
Height2=Reflect.RunMethod("getHeight")
TotalHeight=TotalHeight+Height+Height2
Agendaoverzicht.Panel.Height=TotalHeight
Next