473,388 Members | 1,309 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,388 software developers and data experts.

Application.Run(frmMain)

Whats the purpose of

Application.Run(frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()

???
Nov 21 '05 #1
3 1153
"D Witherspoon" <dw**********@noway.org> schrieb:
Whats the purpose of

Application.Run(frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()


Documentation on 'Application.Run':

| Begins running a standard application message loop on the
| current thread.

Showing a form by calling its 'Show' method doesn't do that.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2

"D Witherspoon" wrote:
Whats the purpose of

Application.Run(frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()

???


It's used to set up the main message loop on the current thread. The message
loop is what handles incoming messages from windows (mouse was clicked, mouse
was moved etc) and turns them into events that you can handle.
Without it once the sub main has finished your application exits.

James

Nov 21 '05 #3
Application.Run(), begins running a standard application message loop on the
current thread taking as parameter the form that's going to be the main
entry point of your application. In change, the way you say only creates an
instance of a form, quicky display it and the exits.

Hope this may help you,

Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda

"D Witherspoon" <dw**********@noway.org> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
Whats the purpose of

Application.Run(frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()

???

Nov 21 '05 #4

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

Similar topics

0
by: MDB | last post by:
I have a strange problem. I recently made the leap from VB6 to VB.NE I built a simple test Windows application with 2 forms that logs into an Accounting system using its COM control. The reference...
4
by: W Hoover | last post by:
I have a problem I can't find a solution for. I have given my users the ability to restart the application from the File menu. I don't know how to re-invoke the sub main() in my .vb module -- in...
3
by: D Witherspoon | last post by:
Whats the purpose of Application.Run(frmMain) in the Sub Main method. Why not just... Dim fMain as New frmMain frmMain.Show() ???
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
12
by: Dean Slindee | last post by:
My project has a main form (frmMain, the startup object for the project) and several other "child" forms that are painted within a large panel on frmMain. In each form's Form_Load event, a Weak...
0
by: marcmc | last post by:
This is kinda hard to explain so here goes. I have a project as follows... I don't wont a web service or a console service application. 1st interface (SQL Server) Nightly Load to data warehouse...
6
by: ahmad.humyn | last post by:
I have an application in which the main form goes something like: public frmMain() { frmA frm = new frmA(); frm.show(); this.hide(); } Now that the control has been passed to frmA, how do...
13
by: Garry | last post by:
Why is it that my installation od vs2005 will not accept My.Application.OpenForms saying that it is not part of My.Application??? Dim frm As Form For Each frm In My.Application.OpenForms Next...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.