03-2-2006, 10:43 AM | #1 |
Banned
|
VB.net
I'm currently making an extremly large program, and I'd like to know if there's a way to pull a variable from one form and use it in another. I've tried the SHARED and FRIEND functions, but neither of them work.
|
03-3-2006, 09:02 PM | #2 |
Away from Computer
|
Re: VB.net
I think you have to make it a global variable.
I haven't used VB in a long time, so I'm not sure how, but that might be somewhere to start looking.
__________________
|
03-3-2006, 09:34 PM | #3 |
FFR Player
|
Re: VB.net
This is exactly what modules are for. Any variable and any function, that is in the module, can publically be accessed as if it were a local object, the way you normally would. Just go to project, add module, and dimension the variable as global or public ie. "Global foovariable" or "Public foovariable".
Most professionals put almost all of their functions and main variables for specific task related programs in here, so later, if they are working on a project in which they could use some of what they already wrote, they can easily import the module and call those functions.
__________________
Last edited by deposition; 03-3-2006 at 09:41 PM.. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|