TabIndex does not work correctly
.net, c#, winforms
Solution
For System.Windows.Forms.GroupBox:
You should make sure that your GroupBox `flag` has an appropriate TabIndex set.
From MSDN - How to: Set the Tab Order on Windows Forms:
Additionally, by default, a GroupBox control has its own TabIndex value, which is a whole number. A GroupBox control itself cannot have focus at run time. Thus, each control within a GroupBox has its own decimal TabIndex value, beginning with .0. Naturally, as the TabIndex of a GroupBox control is incremented, the controls within it will be incremented accordingly. If you changed a TabIndex value from 5 to 6, the TabIndex value of the first control in its group automatically changes to 6.0, and so on
Also, make sure the TabStop property of your GroupBox `flag` is not set to false. I believe false is the default.
For System.Windows.Controls GroupBox:
Make sure that the GroupBox.IsTabStop property is set. This also defaults to false.
Update: It appears that all of your controls are being added to `groupBox3`. You should make sure that each of them is being added only to its containing groupbox. For example, `checkBox1`, `checkBox2`, and `checkBox3` should all be added to `flag`, which itself should be added to `groupBox1`. `groupBox3` should only contain Back, Next, Finish, and Cancel.
Problem
I have a windows form application. On the form there are three groupboxs. Each groupbox contains some controls. Please see the image. There is a groupbox "flag" that contains a few checkboxs. "flag" is inside in "groupbox1". I used Tab key to go through each control but it doesn't work for checkboxs in "flag". I did set proper tabindex for each control. It works for textboxs and buttons but checkboxs. Why? Thanks for help. EDIT ``` // groupBox2 // this.groupBox2.Controls.Add(this.pictureBox10); this.groupBox2.Controls.Add(this.pictureBox9); this.groupBox2.Controls.Add(this.pictureBox8); this.groupBox2.Controls.Add(this.pictureBox7); this.groupBox2.Controls.Add(this.chkStoplight); this.groupBox2.Controls.Add(this.lblStoplight); this.groupBox2.Controls.Add(this.chkIsCount); this.groupBox2.Controls.Add(this.chkExceptionFlag); this.groupBox2.Controls.Add(this.chkIsActive); this.groupBox2.Controls.Add(this.lblIsActive); this.groupBox2.Controls.Add(this.lblExceptionFlag); this.groupBox3.Controls.Add(this.lblIsCount); this.groupBox2.Location = new System.Drawing.Point(16, 201); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(321, 70); this.groupBox2.TabIndex = 10; this.groupBox2.TabStop = true; this.groupBox2.Text = "Flags"; // // chkStoplight // this.chkStoplight.AutoSize = true; this.chkStoplight.Location = new System.Drawing.Point(44, 25); this.chkStoplight.Name = "chkStoplight"; this.chkStoplight.Size = new System.Drawing.Size(15, 14); this.chkStoplight.TabIndex = 0; this.chkStoplight.UseVisualStyleBackColor = true; In the property, I found TabStop is true for chkStoplight. ```