I am newbie to programming, this is my code
int c = 0;
private void button1_Click_1(object sender, EventArgs e)
{
ComboBox txtRun = new ComboBox();
txtRun.Name = "txtDynamic" + c++;
txtRun.Location = new System.Drawing.Point(30, 18+(30*c));
this.Controls.Add(txtRun);
panel1.Controls.Add(txtRun);
}
i am making a combobox which is added dynamically on a windows form, it places the combobox one after the other, and i used panel so that the other control cannot be effected by the adding of runtime control, here the problem is when i click the button and add new combobox to the panel, it adds successfully and my panel size is
Quote:
260, 181
so when i add 5 combobox then i have to scroll to see the 5th combobox.(scroll the panel not the form), and the main problem persist here, when i scroll and the focus is on 5th combobox and then when click on button for adding new combobox then the location of the new combobox is double the location of combobox which i have made earlier so, it looks odd, that five of combobox are in sequence and the 6th one is at the larger distance below that, how to solve this problem, plz help
sorry for my bad english