Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Variable in VB.net Project  (Read 3785 times)

0 Members and 1 Guest are viewing this topic.

almn

  • Guest
Variable in VB.net Project
« on: November 11, 2006, 09:46:57 AM »
Hello,

I would like to know how to set a variable that can be read by all of my forms in vb.net, meaning that my form 1 could set it as variable = 1 and the form 2 would show it on a label. Hope this is clear if you need anything else please ask.

Thanks

Al968

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Variable in VB.net Project
« Reply #1 on: November 11, 2006, 03:06:57 PM »
Create a module  and under the "General Declarations" insert your variable declaration. Global variables must be declared outside any subs or functions. Globals can be strange animals, better to pass the data on a sub or function call.

 8-)

The programming board has not seen this much action since Bill Gates realized he could profit off a product named BASIC.
« Last Edit: November 11, 2006, 03:10:18 PM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

almn

  • Guest
Re: Variable in VB.net Project
« Reply #2 on: November 11, 2006, 06:00:29 PM »
Thanks,I got it  ;)
Now that I knew that the variable was called a variable I googled and found many websites explaining how to do it.

Al968