how to show windows form1 to windows form2.
if i am in form1 in that i have button like "OK" if click ok it need show form2. how to give this?
Windows form
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 22, 2015, 11:31 PM EDT
form2 frm=new form2();
frm.show():
Keyur PatelRank #1,216 · 1.5K reputationPosted Mar 22, 2015, 11:32 PM EDT
You can do it as shown in following code. Hope , it would help to you.
Reference link : https://msdn.microsoft.com/en-us/library/ws1btzy8(v=vs.90).aspx
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnOk_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2();
frm2.Show();
this.Hide();
}
}
Durga VelusamyRank #4,868 · 321 reputationPosted Mar 23, 2015, 12:57 AM EDT