Hi All,
I am new to C#. Please need your help. I have a set of 3 buttons in form1 out of which when I click on any, that particular value of the button gets assigned to text field in form2. I have used below code:
Form1:-
private void Btn1_Click(object sender, EventArgs e)
{
Navigator.Forward(Views.Form2);
Form2 frm = new Form2(Btn1.Text);
frm.Show();
}
private void Btn2_Click(object sender, EventArgs e)
{
Navigator.Forward(Views.Form2);
Form2 frm = new Form2(Btn2.Text);
frm.Show();
}
private void Btn3_Click(object sender, EventArgs e)
{
Navigator.Forward(Views.Form2);
Form2 frm = new Form2(Btn3.Text);
frm.Show();
}
Form2:-
public Form2(string BtnText)
{
InitializeComponent();
TxtBox.Text = BtnText;
}
Any help would be appreciated...Thanks in advance!