Reputation: 5
First form a couple of textboxes with Id, Name, Address, phonenumber
I want these to follow to the next form that has the same textboxes and a couple of more with message and extra and then choose between active and closed. Then I want it to be in different listviews. One with all the active and one with all the closed ones.
I want to be able to get all the info when I press one of the saved in the listviews. Can anyone help me?
Upvotes: 0
Views: 100
Reputation: 2566
Form1 Code
private void button1_Click(object sender, EventArgs e)
{
frm2 frmnew2 = new frm2();
frmnew2.Id = Convert.ToInt32(TxtId.Text);
frmnew2.EmpName = TxtName.Text;
frmnew2.Add = TxtAdd.Text;
this.Hide();
frmnew2.Show();
}
Form2 Code
public Int32 Id { get; set; }
public string EmpName { get; set; }
public string Add { get; set; }
private void frm2_Load(object sender, EventArgs e)
{
TxtId.Text = Id.ToString();
TxtName.Text =EmpName;
TxtAdd.Text = Add;
}
Upvotes: 0
Reputation: 1447
You can take a look at this two examples: 1. http://social.msdn.microsoft.com/Forums/en-US/d0ced05a-e930-4ffd-8ead-1004b9c579a4/passing-values-from-one-windows-form-to-another-windows-form-using-cnet 2. http://msdn.microsoft.com/en-us/library/ms171925.aspx
Upvotes: 0
Reputation: 13892
what do you mean by active and closed?
for passing data between forms you can see this for a headstart : http://www.codeproject.com/Articles/14122/Passing-Data-Between-Forms
Upvotes: 2