473,385 Members | 1,757 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.

MODULES VB6-to-.NET

in VB6, I created all my public variables in a module and
made the module the startup object which called the first
form.

In .NET, how do I do this in .NET???

Thank You

mc**@9minds.com
Nov 20 '05 #1
3 1082
Cor
Hi James,

While I see that a lot here are still using the module as a startup project,
it is not more useal to place all your variables in that.

For that it is better to keep the variables in the seperate classes, but you
can do it on the same way if you was used to, if you wish.

I don't like modules so also not this one I understand that for those who
come from VB6 that this is very pretty to use. It is very common used in
this newsgroup.

\\\
Imports System.Windows.Forms
Public Module Main
Public Sub Main
Application.Run(New Form1())
End Sub
End Module
///

I hope this helps a little bit.

Cor
Nov 20 '05 #2
The code should be roughly as follows :

Module MyModule
Public Sub Main()
Dim theMainForm as New MyForm
theMainForm.Show
Application.Run(theMainForm)
End Sub
End Module

You can just write this in an empty code file or use the Add New Module... menu.
Nov 20 '05 #3
* "James Mattison" <an*******@discussions.microsoft.com> scripsit:
in VB6, I created all my public variables in a module and
made the module the startup object which called the first
form.

In .NET, how do I do this in .NET???


\\\
Public Module Globals
Public UserId As Integer
...
End Module
///

You can access the globals, for example, by typing 'Globals.UserId =
23'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

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

Similar topics

5
by: 2803stan | last post by:
I asked this last year, but never received a satisfactory answer: <<Has the promise of stored procedures written in VB6 been fulfilled in 8.2? If there be a special syntax, and where do I find...
2
by: Kelvin | last post by:
Hello, I have VB6 Pro SP5 installed on my computer, and have few VB6 projects still working on. Will I trash the existing VB6 projects by installing VB.Net on the same computer ? Even if...
3
by: William Gower | last post by:
We are gradually converting a huge vb6 app to .net. How can I call a .net winform from a button on a vb6 form?
1
by: Franky | last post by:
Tengo un problema con un programa en vb6 sp6 que cuando lo instalo en un ordenador con sistema xp o nt, funciona todo correcto menos los menus y si pulso donde deberia estar el menu y que aparece...
173
by: Zytan | last post by:
I've read the docs on this, but one thing was left unclear. It seems as though a Module does not have to be fully qualified. Is this the case? I have source that apparently shows this. Are...
4
by: Ed Leafe | last post by:
I have a simple module that reads in values from disk when imported, and stores them in attributes, allowing for code like: 'the value' What I'd like to do is have a more property-like...
0
by: pragyasharma | last post by:
Hello There is a problem facing by me is merging of various modules developed in vb.net. There are varous members working on various modules for a software on different machines of similer...
0
by: Ginger | last post by:
like appuifw/graphics/sysinfo modules, i've get some primary modules of these, they do what they did on S60 platform. u can get them from http://pdis.hiit.fi/pdis/ but these modules i get are...
0
by: mazdotnet | last post by:
Hi, I'm using UrlRewriter.NET in my project which is causing problems when in Vista (same code works fine on Windows XP). I'm going by the example in Scott's Blog...
11
by: r0g | last post by:
I'm collecting together a bunch of fairly random useful functions I have written over the years into a module. Generally speaking is it best to a) Import all the other modules these functions...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.