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

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

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.