Pass value from one form to another form in c#
pass id from one form to another from in C#.
In Form1
private void ShowForm2() { string value = TheTextBox.Text; Form2 newForm = new Form2(); newForm.TheValue = value; newForm.ShowDialog(); } In Form2
private string _theValue; public string TheValue { get { return _theValue; } set { _theValue = value; // do something with _theValue so that it // appears in the UI } }
6
Dec
Dec
Labels:
CSharp
Pass value from one form to another form in c#
Posted by
csharp
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment