textbox1 and textbox2 are public right?
Ok, another way:
Code:
// form1
public Form1()
{
InitializeComponent();
String newstring = null;
string mystring = "hello";
XmlDOcument myXmldocument = new XmlDOcument(); // this is already opened prior to the index changing in combo box
// contains 2 textboxs - textbox1 - textbox2.
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Populate pop = new Populate();
newstring = pop.populatemember(myXmldocument, mystring, textbox1, textbox2);
}
//populate.cs
public class Populate
{
public string PopulateMember(XmlDocument myDoc, string name, TextBox box1, TextBox box2)
{
box1.Text = " blah blah";
box2.Text = "blah blah";
return mynewstring;
}