Hi
Ijust started learning c# windows forms and when i set soe data open a new form and get the data into the label the label dissappears.can some one help me please
private string greeting;
public string Greeting
{
get
{
return greeting;
}
set
{
greeting = value;
}
}
public Class1()
{
}
Class1 a = new Class1();
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
label1.Text =("hello");
a.Greeting = "hello";
}
private void button1_Click(object sender, EventArgs e)
{
Form2 F2 = new Form2();
F2.Show();
}
public partial class Form2 : Form
{
Class1 b = new Class1();
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = b.Greeting;
}