WinForms Tab Order not working

So I just wasted 2 1/2 hours tring to figure out the WHY the Tab ordering was not working on my Form (C# project Visual Studio 2010).

No matter what I did the order DID NOT CHANGE. There are all kinds of controls like Groupboxes, Panels with Controls inside Controls. No big deal. The View -> Tab Order feature made NO DIFFERENCE at all!!

The only way the tab Order worked was by actually updating the DESIGNER to order the Controls in the way I wanted! Like this...

            this.pnlSubAbc.Controls.Add(this.lblProductA);
            this.pnlSubAbc.Controls.Add(this.cboProductA);           
            this.pnlSubAbc.Controls.Add(this.lblProductAH2S);
            this.pnlSubAbc.Controls.Add(this.txtProductAH2S);  
            this.pnlSubAbc.Controls.Add(this.lblProductB);
            this.pnlSubAbc.Controls.Add(this.cboProductB);        
            this.pnlSubAbc.Controls.Add(this.lblProductBH2S);
            this.pnlSubAbc.Controls.Add(this.txtProductBH2S);
            this.pnlSubAbc.Controls.Add(this.lblProductC);
            this.pnlSubAbc.Controls.Add(this.cboProductC);
            this.pnlSubAbc.Controls.Add(this.lblProductCH2S);
            this.pnlSubAbc.Controls.Add(this.txtProductCH2S);
            this.pnlSubAbc.Location = new System.Drawing.Point(3, 344);
            this.pnlSubAbc.Name = "pnlSubAbc";
            this.pnlSubAbc.Size = new System.Drawing.Size(562, 212);
            this.pnlSubAbc.TabIndex = 2;
            this.pnlSubAbc.TabStop = false;
            this.pnlSubAbc.Text = "Products Carried";

Hope this Helps someone else out there.

Add comment

Loading