Memento

Memento

  • NA
  • 111
  • 133.3k

c# - winform - passing variables between forms

Apr 15 2012 9:32 AM
c# - winforms
On Form1 I have a Button and a Label (Label1)
ButtonClick:
Form2 Form2 = new Form2();
Form2.ShowDialog();
On Form2 I have a dgv
Form2.ClosingEvent:
string abc = Form2.dgv.CurrentCell.Value.ToString();
Form1.Label1.Text = abc;
How could I do this?

Answers (4)