Click here to Skip to main content
14,741,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to get the another form when one button is clicked in the form1 and that form2 contains some other information in C#.net
Posted
Comments
King Fisher 17-Nov-14 5:29am
   
simple one ,google it you can find :)
aarif moh shaikh 17-Nov-14 5:36am
   
It's a very simple ... please use google for it..
BillWoodruff 17-Nov-14 8:54am
   
I believe you are asking about when there is an instance of Form2 created, and showing, and there is some data present in some Control or Class in the Form2 that you wish to retrieve when you click a button on Form1 ... correct ?

What is the data on Form2 you wish to get access to in Form1 ?

Is Form1 the Main Form of a Win Form application: does Form1 create the instance of Form2 ?
Srikanth59 17-Nov-14 23:51pm
   
i created one main form which have three 3 buttons each button will open different form when we click on button in form1 it display the form2 that contains the list of files

Hi,


Create object of Form2 on button Click and call ShowDialog() method.

private void button1_Click(object sender, EventArgs e)
      {
Form2 frm=new Form2();
frm.ShowDialog();
      }
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900