Can I use modules (i.e Module1.bas) under Visual Basic 2008?
-
After exploring other idea, I was thinking that why shouldn't I be able to use a module under Visual Basic 2008? I am looking for a way to create some globally used variables representing values and objects (lists and such) to be used across any / all forms in a project I'm working on. I've used modules for this purpose under older versions of Visual Basic (i.e. VB6); however, I have not thought of using them under a .NET version of Visual Basic until now. Am I approaching this idea in the wrong manner? I feel that if I create a class module and create properties and such within this class module, then I'll not get the use that I'm expecting because I would have to create a new instance of the moduel at the beginning of each and every form; hence, the values of the properties would be reset and not carry the values that I've set in place. Thoughts?
-
Answer:
Yes, you can use modules that share data/procedures across all classes. It's not the prettiest way to program and there's many people that say you shouldn't but I've had to do it a couple of times. You could also look at using shared classes, it depends on what your project needs are. Basically, as long as your not calling the project you're creating in another project you should be fine. Have fun
JammersH... at Yahoo! Answers Visit the source
Related Q & A:
- Why can I not send my e-mail?Best solution by Yahoo! Answers
- How can I use my signature for my e-mail?Best solution by Yahoo! Answers
- Can I set up my e-mail account in Microsoft outlook even if I have a free e-mail account with yahoo.ca?Best solution by Yahoo! Answers
- What products can I use if I have facial eczema?Best solution by everydayhealth.com
- How do I output from one form to another in Visual Basic?Best solution by support.microsoft.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.