demise
September 16th, 2009, 04:49 AM
I did a quick search and found nothing on this subject, so I hope I don't repost or anything.
Scenario:
I have Form1, and Form2. I want data from text boxes on Form2 to be placed inside a Class node (which Form1 has declared).
I haven't used GUI's in C# much, so I dont know the best way to go about this.
In Form1 I have declared like such:
private HolderSLL List;
private Node _head;
private Node _current;
and I have been working with the _head and _current etc through Form1 (firstly, is this ok?) Secondly, I want when I am in Form2 and want to Hit a button and essentially add the text in the boxes into a new node. (But this is out of scope). I was was thinking of doing a return with a string of arrays, but I get an error 'Wrong type' Yet.... I am still unsure if this is the correct way anyway. All advice is hugely appreciated. Thank you very much.
P.S - Here is what I was attempting to do (Wrong or Right, I don't know.)
private String[] btnAccept_Click(object sender, EventArgs e)
{
String[] Info = new String[4];
Info[0] = txt1.Text;
Info[1] = txt2.Text;
Info[2] = txt3.Text;
Info[3] = txt4.Text;
Info[4] = txt5.Text;
return Info;
}
Scenario:
I have Form1, and Form2. I want data from text boxes on Form2 to be placed inside a Class node (which Form1 has declared).
I haven't used GUI's in C# much, so I dont know the best way to go about this.
In Form1 I have declared like such:
private HolderSLL List;
private Node _head;
private Node _current;
and I have been working with the _head and _current etc through Form1 (firstly, is this ok?) Secondly, I want when I am in Form2 and want to Hit a button and essentially add the text in the boxes into a new node. (But this is out of scope). I was was thinking of doing a return with a string of arrays, but I get an error 'Wrong type' Yet.... I am still unsure if this is the correct way anyway. All advice is hugely appreciated. Thank you very much.
P.S - Here is what I was attempting to do (Wrong or Right, I don't know.)
private String[] btnAccept_Click(object sender, EventArgs e)
{
String[] Info = new String[4];
Info[0] = txt1.Text;
Info[1] = txt2.Text;
Info[2] = txt3.Text;
Info[3] = txt4.Text;
Info[4] = txt5.Text;
return Info;
}