The value of the fourth TextBox should be set in the TextChanged event of one or more of the TextBoxes that will effect it.
In the
Add button's Click event, do the following:
Step 1. Create new TextBoxes:
TextBox[] newRow = new TextBox[]{
new TextBox(),
new TextBox(),
new TextBox(),
new TextBox()
}
Step 2. Adjust the properties on each of the TextBoxes to fit your display needs:
newRow[0].Location = new Point(x,y);
newRow[0].Size = new Size(w,h);
newRow[0].Visible = true;
...etc.
Step 3. Hook the event handlers to the TextBoxes (these event handlers should already exist for the initial four TextBoxes):
newRow[0].TextChanged += new TextChangedEventHandler(TextBox1_TextChanged);
newRow[1].TextChanged += new TextChangedEventHandler(TextBox2_TextChanged);
...etc.
Step 4. Add to form/control:
form1.Controls.AddRange(newRow);