"Ben" <Be*@discussions.microsoft.com> schrieb:
could someone please suggest to me another way to work around sub main? I
am
currently migrating 6.0 codes over to .net. as soon as sub main() ran, vb
ends the application immediately. So I moved my codes to over to my
splash
screen form. Made my project preference to run from splash screen as
start
up. after the splash screen is shown, I ordered it to show my next screen
by
calling to a new instance of that new screen. However, no matter what I
do,
my program failed to display my next screen. My application keeps ending
itself.
\\\
Public Module Program
Private m_Context As ApplicationContext
Public Sub Main()
Context = New ApplicationContext()
Context.MainForm = New SplashForm()
Application.Run(Context)
End Sub
Public Property Context() As ApplicationContext
Get
Return m_Context
End Get
Set(ByVal Value As ApplicationContext)
m_Context = Value
End Set
End Property
End Module
Public Class SplashForm
Inherits Form
Private WithEvents m_CloseTimer As New Timer()
Public Sub New()
Me.Text = "Spash form"
End Sub
Private Sub Form_Load( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Load
m_CloseTimer.Interval = 1000
m_CloseTimer.Enabled = True
End Sub
Private Sub m_CloseTimer_Tick( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles m_CloseTimer.Tick
m_CloseTimer.Enabled = False
Program.Context.MainForm = New MainForm()
Me.Close()
Program.Context.MainForm.Show()
End SUb
End Class
Public Class MainForm
Inherits Form
Public Sub New()
Me.Text = "Main form"
End Sub
End Class
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>