473,480 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

sub Main as Startup

How do I use sub Main as a startup? The following of course exitst
immediately. A loop would just eat up processor cycles. If I use
ShowDialog(), application exits as soon as the second form is launched by
the first form. (Many forms many instances of each form.) What is the proper
way?

main.vb
Module startup
Public Sub Main()
' Initialize Globals
Nov 20 '05 #1
3 1644
application.run(new frmmain)

hth,

steve

"tlynch" <tl****@accesstoledo.com> wrote in message
news:vp************@corp.supernews.com...
How do I use sub Main as a startup? The following of course exitst
immediately. A loop would just eat up processor cycles. If I use
ShowDialog(), application exits as soon as the second form is launched by
the first form. (Many forms many instances of each form.) What is the proper way?

main.vb
Module startup
Public Sub Main()
' Initialize Globals
.

Dim mfrmMain As New frmMain
mfrmMain.Show()
End Sub
End Module

Thanks

Nov 20 '05 #2
In addition to what Steve said, make sure you specify Sub Main as the start
up object in your Assembly properties dialog.
"tlynch" <tl****@accesstoledo.com> wrote in message
news:vp************@corp.supernews.com...
How do I use sub Main as a startup? The following of course exitst
immediately. A loop would just eat up processor cycles. If I use
ShowDialog(), application exits as soon as the second form is launched by
the first form. (Many forms many instances of each form.) What is the proper way?

main.vb
Module startup
Public Sub Main()
' Initialize Globals
.

Dim mfrmMain As New frmMain
mfrmMain.Show()
End Sub
End Module

Thanks

Nov 20 '05 #3
* "tlynch" <tl****@accesstoledo.com> scripsit:
How do I use sub Main as a startup? The following of course exitst
immediately. A loop would just eat up processor cycles. If I use
ShowDialog(), application exits as soon as the second form is launched by
the first form. (Many forms many instances of each form.) What is the proper
way?

main.vb
Module startup
Public Sub Main()
' Initialize Globals
.

Dim mfrmMain As New frmMain
mfrmMain.Show()
Replace the lines above with:

\\\
Application.Run(New frmMain())
///
End Sub
End Module


--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

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

Similar topics

20
3292
by: andre | last post by:
HI, I’m learning C# and already know VB .Net. I noticed that C# you have a Static Void Main () (entry point of the app). Well that got me thinking, I was told that VB.net removed “The...
45
3551
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes...
27
1997
by: poiuz24 | last post by:
aeh, this may be stupid, but could s.b. please explain to me why the following won't link (gcc 3.3)? foo.cpp = """ namespace foo { int main () { return 0; }
12
1725
by: Bill Cunningham | last post by:
> #include <stdlib.h> > #include <stdio.h> > > int main(int argc, char *argv) { > FILE *in, *out; > > if(argc==1) > { > in = stdin; > out = stdout;
75
9800
by: Beni | last post by:
I have been programming in C for about a year now. It sounds silly, but I never took the time to question why a C(or C++ or Java) program execution begins only at the main(). Is it a convention or...
4
1892
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...
16
2097
by: Geoff Jones | last post by:
Hi What is the closest equivalent to Main in a VB.Net form? Geoff
12
2698
by: Brian Shafer | last post by:
Hi, In VB Classic I used a sub main() in all my programs. How do I do that in VB.net without setting the application type to Console application? Looks like when I set it to console it disable...
16
1459
by: Adam Honek | last post by:
This is probably the most silly question asked here but I just can't figure it out. In VB6 letting Sub Main() be the app's startup directory was real easy under project properties. In VB.Net...
14
1649
by: Sumit77Sen | last post by:
who calls main() ?
0
7050
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
7091
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...
1
6743
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
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.