• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Dim Public?

I set a variable in the top of a form Class but then in another form I can't see it. I thought that if something is public it would be seen everywhere. How can I have it seen in anther form/class?
0
szx248
Asked:
szx248
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
Hi szx248,

It is visible if you own the instance of this other class:

dim x as new Form1
'Now you have access to public variables of Form1 using the variable X
x.PublicVariable = Something

Cheers!
0
 
strickddCommented:
I belive you want to make it Public Shared. Then to access it in another form you do:

formname.VarName

where fromname is the name of the form where the variable is declared.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now