|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Lauching a form from another formWindows form application
I have an accounting application, the main form of that application can be launched from other application passing the account number or it can be started as a standalone application. If it is started as a standalone application It shoud prompt a dialog box asking for account number. if the account number is valid it will launch a main form passing the account number I currently have a Sub Main(ByVal Args() As String) and I am passing command line arguments it it is open from the other application And no argument is passed I open up account number form but the thing is as soon as I close the account number form it closes my entire application. any solution? fortunatly if your using 2005, theres a simple solution, in your project
properties theres an option of Exit Application When...and you can select When First Form Closes or When last Form Closes....so pick when last form closes. if your using 2003....well i never quite took the time to figure out how to stop that from happening.... -- -iwdu15 When you use Sub Main (you must have to uncheck) use application
framework. so you do not have shutdown mode optioins available. it may nto be the best method, but if your starting up from Sub main, make
your form variable a global variable, then in your form closing event, hide your form. when you want to exit your app in other forms, say Application.Exit() and i know your not supposed to do this...but i forget the other way of preventing this action -- -iwdu15 c_shah wrote:
Show quoteHide quote > Windows form application I wrote a Sub Main based VB app (with VS2005) that opens a couple of> > I have an accounting application, the main form of that application can > be launched from other application passing the account number or it > can be started > as a standalone application. If it is started as a standalone > application It shoud prompt a dialog box asking for account number. > if the account number is valid it will launch a main form passing the > account number > > I currently have a Sub Main(ByVal Args() As String) and I am passing > command line arguments it it is open from the other application > > And no argument is passed I open up account number form but the thing > is as soon as I close the account number form it closes my entire > application. > > any solution? forms using the Form.Show method, and when those forms close, the app doesn't end. And the code later opens the main form with an Application.Run(mainform) command. If the Sub Main code comes to the End Sub, the app will close. But the Application.Run method keeps the app alive until the form referenced in the .Run method is closed. At least that's how it works for me.
Lookup table in a Label
is Recursive Procedures/Function what i need to solve my problem? Making Tag with Web.UI.Control consume web service via httpwebrequest Limit to range of colors displayed by Label control? How to remove an empty array ? Batch file question Transitioning to VB.NET Writing a Browser Helper Object in VB6 forum |
|||||||||||||||||||||||