Since the ComboBox
on your Form 1 is not public
you would need an extra field or property as transfer object:
public partial class Form1 : Form
{
public ComboBox comboTransfer;
public Form1()
{
InitializeComponent();
// example combobox
this.comboBox1.Items.AddRange(new string[] { "1", "2", "3" });
// reroute the content
this.comboTransfer = comboBox1;
}
}
In Form 2 you could access then this transfer object
public partial class Form2 : Form
{
Form1 Form_1;
public Form2()
{
InitializeComponent();
Form_1 = Application.OpenForms["Form1"] as Form1;
}
private void BookSetupForm_Load(object sender, EventArgs e)
{
// access here your transfer object
this.comboBox1.DataSource = Form_1.comboTransfer.Items;
}
}
this is just one way of doing it (first that came to my mind)