Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 26th, 2005, 01:45 PM
Authorized User
 
Join Date: Jun 2003
Location: Northbrook, Illinois, USA.
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing data between forms

Can anyone tell me how to pass data from one control on a form to a different form?

Thanks

Renee C. Walker
__________________
Renee C. Walker
Reply With Quote
  #2 (permalink)  
Old January 26th, 2005, 01:53 PM
Authorized User
 
Join Date: Jun 2003
Location: Rochester, NY, USA.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

are you talking about web forms?
Reply With Quote
  #3 (permalink)  
Old January 26th, 2005, 03:00 PM
Authorized User
 
Join Date: Jun 2003
Location: Northbrook, Illinois, USA.
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, window forms.

Renee C. Walker
Reply With Quote
  #4 (permalink)  
Old February 9th, 2005, 09:15 AM
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use the session object (cookies) Or use the url to pass data

Reply With Quote
  #5 (permalink)  
Old February 16th, 2005, 05:48 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Renee,

Usually what you would do is either expose the control you want to manipulate as public so external code can see and change its properties, or expose just the property you wish to modify with a public property on the form.

-Peter
Reply With Quote
  #6 (permalink)  
Old February 17th, 2005, 08:09 AM
Registered User
 
Join Date: Jul 2004
Location: Roma, Italy, Italy.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tot2ivn
Default

There is several ways to do so, there is a simple one.

///////////Here is the code
//Form1.cs

public Form2 f2;
Form1()
{
  this.f2.ShowDialog();
  this.f2.f1 = this;
}
------------------------
//Form2.cs

public Form1 f1;

private Form2(Form1 f1)
{
   //Get any info of controls or data from Form1
   // As long as you set them as public
  // variables in Form1
   // so you can retrieve them
}

Hope you'll get it !

The prince of Roma !
Reply With Quote
  #7 (permalink)  
Old February 17th, 2005, 08:17 AM
Registered User
 
Join Date: Jul 2004
Location: Roma, Italy, Italy.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tot2ivn
Default

sorry, the Form2 is

private Form2()//as normal instead of

private Form2(Form1 f1) //wrong



The prince of Roma !
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing data on multiple forms dzisaacs C# 2 December 6th, 2007 02:03 PM
Passing Parameters Between Two Forms sjf905 C# 2 January 13th, 2007 10:44 PM
Passing data between forms pactite Access 5 June 4th, 2005 03:02 PM
Passing values between forms alok992 C# 1 April 28th, 2004 04:07 AM



All times are GMT -4. The time now is 02:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.