Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > How can i get one form data into another form
 

How can i get one form data into another form

hi

iwant to know, how can i get one window form data into another window form

like we useSession keyword in asp.net

dipendra

dipendra80  Wednesday, September 03, 2008 7:07 AM

Hi dipendra

I think the most valueable way is use the Constructor of Form. Here is an example.

Form2 is the form that you want to create and convert the data to it.

Code Snippet

public partial class Form2 : Form

{

private string form1String;

public Form2(string stringFromForm1)

{

form1String = stringFromForm1;

}

In Form2, you will recive a string from Form1.

Then in form1, you can create form2 as below to transmit a string to it.

Code Snippet

form2 = new Form2(this.thisFormString);

If I have misunderstood you, please don’t hesitate to tell me.

Sincerely,

Kira Qian

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Kira Qian  Friday, September 05, 2008 7:48 AM

Hi dipendra

I think the most valueable way is use the Constructor of Form. Here is an example.

Form2 is the form that you want to create and convert the data to it.

Code Snippet

public partial class Form2 : Form

{

private string form1String;

public Form2(string stringFromForm1)

{

form1String = stringFromForm1;

}

In Form2, you will recive a string from Form1.

Then in form1, you can create form2 as below to transmit a string to it.

Code Snippet

form2 = new Form2(this.thisFormString);

If I have misunderstood you, please don’t hesitate to tell me.

Sincerely,

Kira Qian

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Kira Qian  Friday, September 05, 2008 7:48 AM

You can use google to search for other answers

Custom Search

More Threads

• Just try too...
• Xpander & chart control
• Thumbnail Generation
• remote server is unreachable or the request has timed out
• Terrarium server !!!
• IssueVision How do I add new users to database?
• Uninstall problem
• bowwow10 - how does he do it?
• Terrarium command line option question
• Trying to find WebBrowserSamples