I want to save my text in a variable in my second form and when I select an item from the listbox it loads the second form and the corresponding text variable so it works as a task manager application.
The name of my first form is form1 and my second form is Description
Here is what I have and it does not work it says I require an object reference in Form1:
private void button1_Click(object sender, EventArgs e)
{
Tdo.addItem(textBox1.Text);
this.Hide();
string Dtext;
Dtext = textBox2.Text;
}
This is my second form code. Now this is my first form:
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Description.Show();
Description.textBox1.text = Description.Dtext
}
I am very new to programming so think that i am in over my head so any help or a better way to do this would be appreciated thank you.