Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2007, 08:11 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default accessin variables from various forms

i need to access string from one particular form in another form..
iam developing a windows application in c#..
need sumthing dat wud work like the way it worked in the good old easy days of VB !!!
lol
anand

 
Old March 6th, 2007, 03:22 AM
Authorized User
 
Join Date: Nov 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi..
When we click the code, u must write... formname fr1=new formname();
Now u can pass the string variable in "new formname()" section just writing
formname fr1=new formname("My name is Subhendu");

Now open the code for formname i.e second form. Write a overloaded constructor for it & parameter wud b the string variable.

So when u invoke the second form, its string parameter version of constructor invoke and u can access that string variable.....

....
Subhendu
 
Old March 8th, 2007, 03:18 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 i got the solution !

have to use namespce of he project. object formname . variable






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem With variables and forms marcrock Classic ASP Databases 1 November 8th, 2005 02:02 PM
Simple 'passing variables between forms' issue... overture C# 4 October 14th, 2005 02:30 PM
Passing variables between forms arcuza General .NET 1 July 11th, 2005 09:08 AM
Forms and variables Dai Beginning PHP 4 June 19th, 2003 02:25 PM





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