Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   sharing variables between two forms (http://www.programmingforums.org/showthread.php?t=12451)

physicist Jan 27th, 2007 10:51 PM

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

kruptof Jan 27th, 2007 11:08 PM

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.

physicist Jan 27th, 2007 11:13 PM

ok. thanks. now i have to learn how to make a module and ill update my graphing calc project posted on this site.

physicist Jan 28th, 2007 12:31 PM

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 Jan 28th, 2007 12:52 PM

nvm i got it. thanks guys


All times are GMT -5. The time now is 1:46 AM.

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