473,396 Members | 2,002 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,396 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 3397
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 !
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.