Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 27th, 2007, 9:51 PM   #1
physicist
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 146
Rep Power: 2 physicist is on a distinguished road
sharing variables between two forms

i tried google, MSDN, my teacher, my book...

how can i share variables between two different forms??

like access a variable assigned a value in Form1 from Form2
physicist is offline   Reply With Quote
Old Jan 27th, 2007, 10:08 PM   #2
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 329
Rep Power: 3 kruptof is on a distinguished road
I think you should try to place the variable you want to share between the forms in an module (i think thats the correct name), and make sure the variable is public so that both forms can access it.
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Jan 27th, 2007, 10:13 PM   #3
physicist
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 146
Rep Power: 2 physicist is on a distinguished road
ok. thanks. now i have to learn how to make a module and ill update my graphing calc project posted on this site.
physicist is offline   Reply With Quote
Old Jan 28th, 2007, 11:31 AM   #4
physicist
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 146
Rep Power: 2 physicist is on a distinguished road
ok how do i make a module. i read up on it and MSDN said that i have to make a dll file? but it didnt show how to organize it codewise...
like i have a module and all it says now it declaring the variables i want to share as global. now how do i assign the value of those variables in the code window. cause i have same lettered variables in both forms os how does it know which variable from form1 to assign a stored value to pass on to the second form
physicist is offline   Reply With Quote
Old Jan 28th, 2007, 11:52 AM   #5
physicist
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 146
Rep Power: 2 physicist is on a distinguished road
nvm i got it. thanks guys
physicist is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing Variables with Multiple Dialogs/Forms PhilBon Visual Basic .NET 6 Oct 11th, 2006 7:14 AM
Variables between forms nez C# 4 Mar 7th, 2006 1:24 PM
Sharing Objects Between Forms Kilo C# 26 Dec 12th, 2005 6:25 PM
Variables coldDeath Python 4 Aug 9th, 2005 11:35 AM
Websites and forms. With VB scorpiosage Visual Basic .NET 1 Feb 1st, 2005 3:21 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:37 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC