473,237 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

Startup Object Sub Main

Hi,
I have to launch my Application after receiveing arguments from outside.
And Sub Main has to be the start up object.
Depending upon the Arguments, a for has to be launched.

After I lauch the form, the application terminates itself when the control
comes out of sub Main.

I want that, the form launched be there. How to go for it.

Thanks in Advance...

Shaurya


Nov 20 '05 #1
4 3392
Hi,

Dim frm as New Form1
Application.Run(frm)

Ken
----------------------
"Shaurya Vardhan" <sh******@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
Hi,
I have to launch my Application after receiveing arguments from outside.
And Sub Main has to be the start up object.
Depending upon the Arguments, a for has to be launched.

After I lauch the form, the application terminates itself when the control
comes out of sub Main.

I want that, the form launched be there. How to go for it.

Thanks in Advance...

Shaurya

Nov 20 '05 #2
I'm not sure I understood your question properly, but I'm guessing that your
form is closing right after it opens and that you want it to open and stay
up until the user closes it. If that's the case, I believe you need to Dim
the form outside of Sub Main().

For example:

Dim frm as Form1

Sub Main() 'Should work
frm = new Form1
frm.Show()
End Sub

Instead of:

Sub Main() ' Will flash and then disappear
Dim frm as Form1
frm = new Form1
frm.Show()
End Sub

HTH

"Shaurya Vardhan" <sh******@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
Hi,
I have to launch my Application after receiveing arguments from outside.
And Sub Main has to be the start up object.
Depending upon the Arguments, a for has to be launched.

After I lauch the form, the application terminates itself when the control
comes out of sub Main.

I want that, the form launched be there. How to go for it.

Thanks in Advance...

Shaurya

Nov 20 '05 #3
thats not a good way to do it, use application.run and applicationcontext to
set a main form.. then run the context

"Jeff Molby" <JeffMolby@C_mc_st.n_t> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
I'm not sure I understood your question properly, but I'm guessing that your form is closing right after it opens and that you want it to open and stay
up until the user closes it. If that's the case, I believe you need to Dim
the form outside of Sub Main().

For example:

Dim frm as Form1

Sub Main() 'Should work
frm = new Form1
frm.Show()
End Sub

Instead of:

Sub Main() ' Will flash and then disappear
Dim frm as Form1
frm = new Form1
frm.Show()
End Sub

HTH

"Shaurya Vardhan" <sh******@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
Hi,
I have to launch my Application after receiveing arguments from outside.
And Sub Main has to be the start up object.
Depending upon the Arguments, a for has to be launched.

After I lauch the form, the application terminates itself when the control comes out of sub Main.

I want that, the form launched be there. How to go for it.

Thanks in Advance...

Shaurya


Nov 20 '05 #4
Thank you. I learn something every day.

"Brian Henry" <br******@adelphia.net> wrote in message
news:Oe****************@tk2msftngp13.phx.gbl...
thats not a good way to do it, use application.run and applicationcontext to set a main form.. then run the context

"Jeff Molby" <JeffMolby@C_mc_st.n_t> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
I'm not sure I understood your question properly, but I'm guessing that

your
form is closing right after it opens and that you want it to open and stay
up until the user closes it. If that's the case, I believe you need to Dim the form outside of Sub Main().

For example:

Dim frm as Form1

Sub Main() 'Should work
frm = new Form1
frm.Show()
End Sub

Instead of:

Sub Main() ' Will flash and then disappear
Dim frm as Form1
frm = new Form1
frm.Show()
End Sub

HTH

"Shaurya Vardhan" <sh******@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
Hi,
I have to launch my Application after receiveing arguments from outside. And Sub Main has to be the start up object.
Depending upon the Arguments, a for has to be launched.

After I lauch the form, the application terminates itself when the

control comes out of sub Main.

I want that, the form launched be there. How to go for it.

Thanks in Advance...

Shaurya



Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus...
4
by: Tony Vitonis | last post by:
Hello. I've written an app that I want to "live" in the system tray. I want it to start up with just a tray icon showing, and if the user selects "Settings..." from the icon's context menu, to...
2
by: BuzzLight | last post by:
This is my problem :- - I have set a form frmSplash as the startup form instead of sub Main. - This means I dont create an instance of it myself at startup.. its automatically created. - I have...
4
by: Chris Ashley | last post by:
I have a class called App set as the startup object with the following code: Friend Class App Shared Sub Main() Dim FrmMain As New MainForm Application.Run(FrmMain) End Sub End Class In...
4
by: Johnnie Miami | last post by:
I'm using VB.Net 2005 beta 2 and have my login form (login.vb) specified as the startup form. If the user is successful logging in, I call my main form (main.vb). This all works fine but the...
10
by: Bernie Hunt | last post by:
This is probably a silly question, but I've gotten myself confused. My app has two forms, form1 and form2. form1 is the start up object in the propers. An event in form1 instantiates form2. ...
3
by: steveeisen | last post by:
I'm a long-time VB6 programmer in a shop that is mostly moving to VB ..NET 2005. And I'm confused about coding the start of solutions for unattended operations. Much of what I write is old-time...
8
by: cj | last post by:
In 2003 I sometimes changed the startup object of a project to Sub Main which was found in Module1.vb. I upgraded one such project to 2005 and I notice in the properties page for the project that...
10
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi In my app I have a SplashScreen, a login form and a main form. On launching the app, I'd like to show the SplashScreen while reading config files and attempting a database connection. I show...
8
by: Rob | last post by:
In VS2003 you had the option to select "Sub Main" as the Startup Object It appears this option is not present in VS2005... Is this the case ? Thanks !
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.