473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sharing Class Data With Multiple Forms

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

Jul 7 '06 #1
5 1086

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.

Jul 7 '06 #2

"Jerry" <je*******@gmail.comschrieb im Newsbeitrag
news:11**********************@k73g2000cwa.googlegr oups.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
Jul 7 '06 #3
"Jerry" <je*******@gmail.comwrote in message
news:11**********************@k73g2000cwa.googlegr oups.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.
Jul 7 '06 #4
Jeff Johnson wrote:
"Jerry" <je*******@gmail.comwrote in message
news:11**********************@k73g2000cwa.googlegr oups.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

Jul 7 '06 #5
In article <11**********************@m73g2000cwd.googlegroups .com>,
je*******@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).
Jul 7 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DaveE | last post by:
I have a project consisting of two forms and a class that I created. The class, called Project, has several properties and a method. Form1 instantiates my Project class and populates the...
2
by: Mervin Williams | last post by:
I am using Infragistics UltraWebTab (a tab folder control for ASP.NET). My tab folder control will include five tab pages with a separate web form on each, and these web forms will share data. ...
11
by: Nick | last post by:
Hello, Please pardon my ignorance as this is something I should know, but I'm a little unclear. I have an MDI based app. It is setup so the user opens a file and the main child form is created....
1
by: Joe | last post by:
While I understand that Server Side Includes still work, I realize it's not the best practice for sharing code such as a common set of includes between screens. In ASP.NET I've already built...
2
by: David | last post by:
How do I share code across files in C#, without including a reference to a class library. Here's what I want to do. I have a device I want to talk to. It's a machine in a factory. It can talk...
6
by: Rajesh | last post by:
Hi, We are tyring to build a DLL which will write the log data to a text file. Multiple executables should use this dll to write data to same text file. We are using a synchronized method...
2
by: =?Utf-8?B?RWl0YW4=?= | last post by:
Hello, My application, winform, need to share data between multiple dialog boxes? What would be the best way to do it? Thanks, EitanB
9
by: kirk | last post by:
I have program.cs, my "main" form and then a "settings" form. My "main" form existed for awhile and I had constants, instantiations, properties, etc within it created. I went to create my...
45
by: =?Utf-8?B?QmV0aA==?= | last post by:
Hello. I'm trying to find another way to share an instance of an object with other classes. I started by passing the instance to the other class's constructor, like this: Friend Class...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.