Form1: namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } public void button1_Click(object sender, EventArgs e) { if (checkBox1.Checked || checkBox2.Checked) { label2.Visible = true; label3.Visible = true; label3.Text = "Will Be Your Life Partener"; if (checkBox1.Checked) { label2.Text = " Mrs." + textBox1.Text + " " + textBox2.Text; } else label2.Text = "Mr." + textBox2.Text; } else { label2.Visible = true; label2.Text = "Please Select Your Prefix"; } } public void button2_Click(object sender, EventArgs e) { label2.Visible = true; label3.Visible = false; label2.Text = "Thank You " + textBox1.Text; LF form2 = new LF(this); form2.ShowDialog(); } private void label3_Click(object sender, EventArgs e) { } public string PublicProperty { get; set; } } } Form2: public partial class LF : Form { public LF(Form1 parent) { this.parentForm = parent; } public LF() { InitializeComponent(); } public void Form2_Load(object sender, EventArgs e) { } public void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Equals("vijay")) { label1.Text = "Mrs. Pareek"; } } public void button2_Click(object sender, EventArgs e) { label1.Text = "Thank You" + textBox1.Text; } public Form1 parentForm { get; set; } }
public LF(Form1 parent) { this.parentForm = parent; }
public LF(Form1 parent) { this.parentForm = parent; InitializeComponent(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)