title: Programmatically hide/remove tabpages in VB.NET
body: <p>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 should be visible and tabpages 4 to 10 must be removed or should not be visible. 
  I tried following without any success,</p>
  
  <pre><code>For i = 0 To 9
  Form1.TabControl1.TabPages.Remove(Form4.TabControl1.TabPages((val(textbox1.text)) + i))
  Next
  </code></pre>
  
  <p>(No exceptions or errors are generated for above statements)</p>
  
  <p>What is wrong with these statements? </p>