0

Hi,
Can anybody help me, I have an tabcontrol which has dynamically added the tabpages now i want to add datagridview controls in each tab pages how i can do this.I am written the code like

For i = TabControl1.TabPages.Count - 1 To 0 Step -1
            Dim dtg As New DataGridView
            TabControl1.TabPages(i).Controls.Add(dtg)
        Next

But it only works for count=1.
Thanks in advance.............

1
Contributor
1
Reply
5
Views
5 Years
Discussion Span
Last Post by bhagawatshinde
0

Hi, i am figure out this thread by using following code...

Dim tabPage As TabPage = New TabPage
            tabPage.Text = "Paper " & k
            Dim grid As DataGridView = New DataGridView
            grid.Dock = DockStyle.Fill
            tabPage.Controls.Add(grid)
            TabControl1.Controls.Add(tabPage)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.