recalling forms in wm5

  • Thread starter Thread starter Chuck Hecht
  • Start date Start date
C

Chuck Hecht

I have been using panels for most of my project (coming from evb i
understood them) I have a project that has a form with c buttons each button
will crete a unique for for that buttons functionality. In button 1 ihave
the code

Dim StagingEvents as new frmStagingevents(passet)
StagingEvents.ShowDialog

(passet is a object of a asset that was previous scanned and found in a
database)

so now that the new form Stagingevents is active how do I kill the mainmenu
form from within the currently active form StagingEvents
 
You'd have to pass the mainform handle to your sub form. Bear in mind if the
mainmenu form was used to setup the message pump (Application.Run) doing this
will end your application.
 
Simon,
Thanks for the reply. I do have a module as the project startup and in the
module I have the following
Public Sub main()

GetSqlCeData()

GetSessionId()

CreateDatasetForScannerData()

'System.Diagnostics.Debugger.Break()

Application.Run(frmLogin)

End Sub

Is this wrong? How would you recommend I manage mulipe forms (+10)

chuck
 
Yes

Then from frmLogin once there is a good username and password they will be
displayed the mainmenu.
From this form there is the possiblity for another 6 forms.

chuck
 
You're only ever supposed to have one Application.Run as this sets up the
message pump for your application. Although it should work (I guess)
terminating one then starting another, it's not good practice.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
 
What would you recommend on the handling of the forms?
I am very concerned that with the total number of forms being
used, I do not want my app to behave poorly or with errors?
 
Have a single main form which then fires off sub forms - this is the usual
way to do things, then dispose these then you're done.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
 
Back
Top