Home All Groups Group Topic Archive Search About

Sharing Class Data With Multiple Forms

Author
7 Jul 2006 1:52 PM
Jerry
I'm developing an application that has an initial login form. It uses a
user class that checks for a valid user. If the user is valid, it
populates public variables in the class, hides the login form and shows
the next form. Is there a way to use the variables from the user class
in the new form that opens?

Thanks,

--
Jerry

Author
7 Jul 2006 1:58 PM
zacks
Jerry wrote:
> I'm developing an application that has an initial login form. It uses a
> user class that checks for a valid user. If the user is valid, it
> populates public variables in the class, hides the login form and shows
> the next form. Is there a way to use the variables from the user class
> in the new form that opens?
>

If you structure your project so that Sub Main is the startup object,
in the Sub Main code you could fire off your login screen with an:

Application.Run(LoginForm)

and the LoginForm instance defined in Sub Main becomes a global
variable, and all properties in it are also available globally. Of
course, the login form would have to open the next form in the chain.
Author
7 Jul 2006 2:03 PM
Schmidt
"Jerry" <jerrya***@gmail.com> schrieb im Newsbeitrag
news:1152280369.706748.173950@k73g2000cwa.googlegroups.com...
> I'm developing an application that has an initial login form. It uses a
> user class that checks for a valid user. If the user is valid, it
> populates public variables in the class, hides the login form and shows
> the next form. Is there a way to use the variables from the user class
> in the new form that opens?

Simply put the UserClass-ObjectVar Public into a *.bas-Module.
This way it is visible to all other "Members" (Forms, Classes) in
your project.

Olaf
Author
7 Jul 2006 4:57 PM
Jeff Johnson
"Jerry" <jerrya***@gmail.com> wrote in message
news:1152280369.706748.173950@k73g2000cwa.googlegroups.com...

> I'm developing an application that has an initial login form. It uses a
> user class that checks for a valid user. If the user is valid, it
> populates public variables in the class, hides the login form and shows
> the next form. Is there a way to use the variables from the user class
> in the new form that opens?

You have posted this question to both .NET and non-.NET groups. Please
determine which version of VB you're using and restrict your posts to the
appropriate groups. The *.vb.* are for VB6 and earlier. The .NET groups have
*.dotnet.* in their names.
Author
7 Jul 2006 6:05 PM
Jerry
Jeff Johnson wrote:
> "Jerry" <jerrya***@gmail.com> wrote in message
> news:1152280369.706748.173950@k73g2000cwa.googlegroups.com...
>
> > I'm developing an application that has an initial login form. It uses a
> > user class that checks for a valid user. If the user is valid, it
> > populates public variables in the class, hides the login form and shows
> > the next form. Is there a way to use the variables from the user class
> > in the new form that opens?
>
> You have posted this question to both .NET and non-.NET groups. Please
> determine which version of VB you're using and restrict your posts to the
> appropriate groups. The *.vb.* are for VB6 and earlier. The .NET groups have
> *.dotnet.* in their names.

I'm using .NET.

I saw various versions of VB being discussed on the general group and
thought that .NET was just another version.

--
Jerry
Author
7 Jul 2006 6:19 PM
David Kerber
In article <1152295504.658863.115***@m73g2000cwd.googlegroups.com>,
jerrya***@gmail.com says...

....

> I'm using .NET.
>
> I saw various versions of VB being discussed on the general group and
> thought that .NET was just another version.

It's enough different that it's practically a new language; that's why
there are two sets of NG's.

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).