473,405 Members | 2,310 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,405 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 2257
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
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.