I have a question here.
- I have a usercontrol called ucDataUser.ascx
- I have a public sub to create new tabpage in tabcontorl
- The tabpage should be dynamically consist of ucDataUser
<pre lang="HTML">The code that I'd tried :
<pre="vb">Public Sub mainTabBaru(ByVal namaTab As String)
Dim c As New TabPage
c.Name = namaTab
If mainForm.TabControl1.TabPages.ContainsKey(namaTab) Then
c.Text = namaTab
Dim nama As String
nama = "uc" + Trim(namaTab)
Dim b As New UserControl
b.Name = nama
b.Parent = c
b.Dock = DockStyle.Fill
namaTab variable on that code should be dynamically change according to the usercontrol that I need to show on the tabpage.
But the result always new empty usercontrol from the code <code>Dim b as new usercontrol</code>.
How's that happen and how to fix it?</pre>