vb.net 2003 module sub main()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi ther
I have a small vb.net 2003 program with 5 forms: form1, form2, et
I have a module in the program from where I want to launch form1 - the main for
In the module I have a bunch of public declarations like
Public carstuf
Public yardstuf
and so o
At the end of the modul
I have a sub mai
The module looks like this
==================
Module myMo
Public carstuf
Public yardstuf
and mor
-----------------
Sub Main(

Can someone please tell what statement I can put in here to load and show form1

End Su
End Modul
===========================
I tried all of the vb6 ways to do this that I know and nothing work
Please...
Thank
 
I finally found this in vb.net2003's help file
=================================
Module Hell
' A "Hello World!" program in Visual Basic

Sub Main(
'MsgBox("Hello World!") ' Display message on computer screen
' Instantiate a new instance of Form1
Dim f1 As New Form
' Display a messagebox. This shows the application is running,
' yet there is nothing shown to the user. This is the point at
' which you customize your form
System.Windows.Forms.MessageBox.Show("The application is running now, but no forms have been shown."
' Customize the form
f1.Text = "Running Form
' Show the instance of the form modally
f1.ShowDialog(
End Su
End Modul
=================================================
Thank

----- Michael Horton wrote: ----

Dim frm as new Form
frm.sho

in Sub Main() should do it
 
Instead of the line
f1.ShowDialog()
,you should probably be using
Application.Run(f1)
To make sure that the message pump is handled correctly.


kyle said:
I finally found this in vb.net2003's help file:
==================================
Module Hello
' A "Hello World!" program in Visual Basic.

Sub Main()
'MsgBox("Hello World!") ' Display message on computer screen.
' Instantiate a new instance of Form1.
Dim f1 As New Form1
' Display a messagebox. This shows the application is running,
' yet there is nothing shown to the user. This is the point at
' which you customize your form.
System.Windows.Forms.MessageBox.Show("The application is running
now, but no forms have been shown.")
 
Aye Aye!! Si

----- Philip Rieck wrote: ----

Instead of the lin
f1.ShowDialog(
,you should probably be usin
Application.Run(f1
To make sure that the message pump is handled correctly


kyle said:
I finally found this in vb.net2003's help file
=================================
Module Hell
' A "Hello World!" program in Visual Basic
'MsgBox("Hello World!") ' Display message on computer screen
' Instantiate a new instance of Form1
Dim f1 As New Form
' Display a messagebox. This shows the application is running
' yet there is nothing shown to the user. This is the point a
' which you customize your form
System.Windows.Forms.MessageBox.Show("The application is runnin
now, but no forms have been shown."
 
Back
Top