G
Guest
I start my applicaiton from sub Main as follows:
<STAThread()>Public Sub Main()
Dim MainForm As frm_Main = New frm_Main
Application.Run(MainForm)
End Sub
In the MainForm, I show a Progress Form as follows:
Private Sub get_Listing()
Dim prform as New ProgBarForm (this is a form I created with a cancel button)
prform.Show()
dim finished as boolean
While not finished
.....Do Something to get my listing items
Application.DoEvents
'Cancel is a property in prform set to True if Cancel button is clicked
.....If prform.Cancel then finished=True
wend
prform.close
End Sub
I get an error in sub main on the Application.Run Line stating that an error
has occured in an external component. However, if I start my application by
setting my Mainform as the Start-Up form then I don't get the error. Only
when I start my application from sub main do I get the error. I have tried
showing Mainform from sub main using MainForm.ShowDialog and still get the
same error.
<STAThread()>Public Sub Main()
Dim MainForm As frm_Main = New frm_Main
Application.Run(MainForm)
End Sub
In the MainForm, I show a Progress Form as follows:
Private Sub get_Listing()
Dim prform as New ProgBarForm (this is a form I created with a cancel button)
prform.Show()
dim finished as boolean
While not finished
.....Do Something to get my listing items
Application.DoEvents
'Cancel is a property in prform set to True if Cancel button is clicked
.....If prform.Cancel then finished=True
wend
prform.close
End Sub
I get an error in sub main on the Application.Run Line stating that an error
has occured in an external component. However, if I start my application by
setting my Mainform as the Start-Up form then I don't get the error. Only
when I start my application from sub main do I get the error. I have tried
showing Mainform from sub main using MainForm.ShowDialog and still get the
same error.