473,395 Members | 1,474 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,395 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 22 '05 #1
3 3089
"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 22 '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 22 '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 22 '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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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
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
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
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
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...

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.