As title, I have a TabControl that does not have any TabPage. By design, TabPages were added to it at runtime by user actions.
However, the Designer will sometimes add a code like this:
this.tabControl1.SelectedIndex = 0;
Since there is no TabPage in this TabControl, the SelectedIndex 0 means the first TabPage and therefore it caused a ArgumentOutOfRangeException at runtime.
I can (and have) remove this line of code from the Form1.Designer.cs file manually, but the Designer will add it back for me some time later. So, hope it can be solved.
Thanks and regards,
Please login first to submit.