I have 10 tabpages on my form. Based on an input in a textbox, I want to programmatically remove number of tab pages, i.e. if textbox input is 3 then only first 3 tabpages s
check this.
For i As Integer = TextBox1.Text + 1 To 9 Form1.TabControl1.TabPages.Remove(Form4.TabControl1.TabPages(TextBox1.Text + 1)) Next
or
For index As Integer = 9 To TextBox1.Text + 1 Step -1 Me.TabControl1.TabPages.Remove(Me.TabControl1.TabPages(index)) Next