473,394 Members | 2,052 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,394 software developers and data experts.

Application.Run without passing first form as argument

I am interested in calling Application.Run() without
passing a first form as the argument to the Run method.
Reason being is that i would like to instantiate some
helper or foundation classes before showing any vestiges
of a form on the screen.

This is how i am trying:
Form1 frm = new Form1();
//form one is empty with a textbox for fun in it
frm.Visible = false;
frm.WindowState = FormWindowState.Minimized;
Application.Run();
HelperClass1 help = new HelperClass1();
help.DoDuties();
frm.Show();

But the form is not showing.

Does anyone know of how to start an application and maybe
not call a form till later.. or hide the form and call
helper classes after. I am interested in not having the
Main method within my first Form's class.

I cant seem to find much in teh way of sample windows
forms applications around in the open source community.
Any Ideas?

Thanks
Jul 21 '05 #1
1 2256
Erik Jensen <an*******@discussions.microsoft.com> wrote:
I am interested in calling Application.Run() without
passing a first form as the argument to the Run method.
Reason being is that i would like to instantiate some
helper or foundation classes before showing any vestiges
of a form on the screen.

This is how i am trying:
Form1 frm = new Form1();
//form one is empty with a textbox for fun in it
frm.Visible = false;
frm.WindowState = FormWindowState.Minimized;
Application.Run();
HelperClass1 help = new HelperClass1();
help.DoDuties();
frm.Show();

But the form is not showing.

Does anyone know of how to start an application and maybe
not call a form till later.. or hide the form and call
helper classes after. I am interested in not having the
Main method within my first Form's class.

I cant seem to find much in teh way of sample windows
forms applications around in the open source community.


Why don't you just make Application.Run your last statement instead of
having it half way down your code?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

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

Similar topics

8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
23
by: jm | last post by:
This works, but I don't know why. static void Main() { // Queue the task. ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc),new Form1()); Application.Run(); }
1
by: Erik Jensen | last post by:
I am interested in calling Application.Run() without passing a first form as the argument to the Run method. Reason being is that i would like to instantiate some helper or foundation classes...
43
by: Christoph Schneegans | last post by:
Hi! Okay, so positions on "text/html" XHTML are totally contradicting. Anyway! I hope there's more consensus about "application/xml" XHTML. I've recently learned that Opera 9.0b2 does not only...
12
by: dave_dp | last post by:
Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned...
3
by: Sylvie | last post by:
My Windows Application has two forms, one form contains a grid (lets say Stock Listing), and the other is a form of one stock, contains some edit boxes for one stock's fields.. Is it possible to...
8
by: S. | last post by:
Hi all, Can someone please help me with this? I have the following struct: typedef struct { char *name; int age; } Student;
11
by: =?Utf-8?B?U2VyZ2lv?= | last post by:
I need to pass two parameter to a vb.net 2003 windows form application, is this posible? how?
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
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:
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
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?
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
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.