I've created an empty tabpage. At runtime i add lots of controls with
this function:
For i = 0 To mani_settings.count
Dim index
Dim label As New Label
label.Top = 12 + i * 26
label.Left = 8
label.AutoSize = True
label.Text = mani_settings.settings(i).name
index = labels_mani_settings.Add(label)
Me.TabPage2_Mani_Settings.Controls.Add(labels_mani _settings(index))
ToolTip1.SetToolTip(labels_mani_settings(index),
mani_settings.settings(i).description)
Dim textbox As New TextBox
textbox.Top = 12 + i * 26
textbox.Left = label.Width + 14
textbox.Width = Me.TabPage2_Mani_Settings.Width -
label.Width - 22
textbox.Height = 20
textbox.Text = mani_settings.settings(i).value
index = textboxes_mani_settings.Add(textbox)
Me.TabPage2_Mani_Settings.Controls.Add(textboxes_m ani_settings(index))
ToolTip1.SetToolTip(textboxes_mani_settings(index) ,
mani_settings.settings(i).description)
Next
Now there are two problems. First if i scroll the tabpage it looks very
ugly. Because it doesen't repaint correctly. if i do a update() on the
form throug the onscrolling event of the tabpage it is better but not
perfect.
The second problem is that it takes about 10 seconds to create all
those controls. This is a bit slow, i think.
Do you now any solution to solve these two problems?
Thanks,
peng12341