J
Jon Brunson
Afternoon All,
In the code below, when it gets to Application.Run(frmMain), it does not
show the form on the device, any ideas why?
If I use frmMain.ShowDialog() it works fine, but then I can't use
Invoke() on the form later on, and I need to.
Help?
[VB.NET]
Private Shared frmSplash As Forms.SplashScreen
Public Shared Sub Main()
While Not File.Exists(Mobile.ApplicationLocation + "settings.xml")
Dim frmInitialize As New Forms.Initialize
If frmInitialize.ShowDialog() = DialogResult.Cancel Then Return
End While
frmSplash = New Forms.SplashScreen
frmSplash.Show()
Application.DoEvents()
Try
If Not (Directory.Exists(Mobile.ApplicationLocation + "Data")) Then
frmSplash.lblStatus.Text = "Creating Local Data Folder"
Directory.CreateDirectory(Mobile.ApplicationLocation + "Data")
End If
frmSplash.lblStatus.Text = "Connecting to Local Database"
PropertySurveys.Common.OpenDatabases()
Catch ex As InnovationException
frmSplash.Close()
MessageBox.Show(ex.Message, Common.ProductName,
MessageBoxButtons.OK, CType(ex.Severity, MessageBoxIcon),
MessageBoxDefaultButton.Button1)
Return
Catch ex As Exception
frmSplash.Close()
MessageBox.Show(ex.Message, Common.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Return
End Try
Dim frmWait As New Forms.PleaseWait("Loading")
frmSplash.lblStatus.Text = "Ready"
Dim frmLogin As New Forms.Login(frmWait)
frmSplash.Close()
frmSplash.Dispose()
If frmLogin.ShowDialog() = DialogResult.OK Then
frmLogin.Dispose()
frmWait.SetProgressBarValue(20)
Dim frmMain As New Forms.Procedures
frmWait.SetProgressBarValue(100)
frmWait.Close()
frmWait.Dispose()
Application.Run(frmMain)
End If
End Sub
[/VB.NET]
In the code below, when it gets to Application.Run(frmMain), it does not
show the form on the device, any ideas why?
If I use frmMain.ShowDialog() it works fine, but then I can't use
Invoke() on the form later on, and I need to.
Help?
[VB.NET]
Private Shared frmSplash As Forms.SplashScreen
Public Shared Sub Main()
While Not File.Exists(Mobile.ApplicationLocation + "settings.xml")
Dim frmInitialize As New Forms.Initialize
If frmInitialize.ShowDialog() = DialogResult.Cancel Then Return
End While
frmSplash = New Forms.SplashScreen
frmSplash.Show()
Application.DoEvents()
Try
If Not (Directory.Exists(Mobile.ApplicationLocation + "Data")) Then
frmSplash.lblStatus.Text = "Creating Local Data Folder"
Directory.CreateDirectory(Mobile.ApplicationLocation + "Data")
End If
frmSplash.lblStatus.Text = "Connecting to Local Database"
PropertySurveys.Common.OpenDatabases()
Catch ex As InnovationException
frmSplash.Close()
MessageBox.Show(ex.Message, Common.ProductName,
MessageBoxButtons.OK, CType(ex.Severity, MessageBoxIcon),
MessageBoxDefaultButton.Button1)
Return
Catch ex As Exception
frmSplash.Close()
MessageBox.Show(ex.Message, Common.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Return
End Try
Dim frmWait As New Forms.PleaseWait("Loading")
frmSplash.lblStatus.Text = "Ready"
Dim frmLogin As New Forms.Login(frmWait)
frmSplash.Close()
frmSplash.Dispose()
If frmLogin.ShowDialog() = DialogResult.OK Then
frmLogin.Dispose()
frmWait.SetProgressBarValue(20)
Dim frmMain As New Forms.Procedures
frmWait.SetProgressBarValue(100)
frmWait.Close()
frmWait.Dispose()
Application.Run(frmMain)
End If
End Sub
[/VB.NET]