MODULES VB6-to-.NET

  • Thread starter Thread starter James Mattison
  • Start date Start date
J

James Mattison

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

(e-mail address removed)
 
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
 
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.
 
* "James Mattison said:
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'.
 
Back
Top