I have set up a program that adds new rows when the checkbox at the end is checked. My problem is with the autoscroll. When the rows get passed the edge of the window, it creates the next row, but it looks like it sets the origin to the previous row's starting point.
Here is some of the code:
private void AddRow(object sender, EventArgs e)
{
bool check = ((CheckBox)sender).Checked;
if (check)
{
proj[i] = new Label();
proj[i].Text = "Proj #";
proj[i].Width = 50;
proj[i].Location = new Point(10, (i * 22) + 50);
...
split[i] = new CheckBox();
split[i].Text = "";
split[i].Location = new Point(430, (i * 22) + 50);
split[i].CheckedChanged += new EventHandler(AddRow);
}
this.Controls.Add(proj[i]);
}
And here are a couple screenshots:
How can I fix this problem?