I'm finally getting up to speed on VS 2005 and see that there is now a class
named Program that contains the main entry point for Windows Forms
applications. Yes, I understand that this is something that VS creates for
us and that we are not *required* to use it as is.
My question:
Are many of you who are writing non trivial Windows Forms applications
keeping this Program.cs file as generated by VS? Are you using it "as is" or
do you throw other things in there? If so, what else do you add to
Program.cs?
(just wondering what most developers think of this change and how you are
using it).
Thanks. 5 3912
Jeremy,
Personally, I think it is a good thing, as it promotes encapsulation
(why have the startup code in the form? It might not have anything to do
with that).
I will add some code to that file easily, but in general, I think it is
better than the old template.
In the end, it is a class in the project like any other. You can modify
it how you wish.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jeremy" <A@B.COMwrote in message
news:u4**************@TK2MSFTNGP03.phx.gbl...
I'm finally getting up to speed on VS 2005 and see that there is now a
class named Program that contains the main entry point for Windows Forms
applications. Yes, I understand that this is something that VS creates for
us and that we are not *required* to use it as is.
My question:
Are many of you who are writing non trivial Windows Forms applications
keeping this Program.cs file as generated by VS? Are you using it "as is"
or do you throw other things in there? If so, what else do you add to
Program.cs?
(just wondering what most developers think of this change and how you are
using it).
Thanks.
"Jeremy" <A@B.COMwrote in message
news:u4**************@TK2MSFTNGP03.phx.gbl...
I'm finally getting up to speed on VS 2005 and see that there is now a
class named Program that contains the main entry point for Windows Forms
applications. Yes, I understand that this is something that VS creates for
us and that we are not *required* to use it as is.
My question:
Are many of you who are writing non trivial Windows Forms applications
keeping this Program.cs file as generated by VS? Are you using it "as is"
or do you throw other things in there? If so, what else do you add to
Program.cs?
(just wondering what most developers think of this change and how you are
using it).
Thanks.
When I use VS2K5, I normally either keep Program.cs or change it to
something else (something that I've used is InternalMain, which is just the
same as Program.cs). Inside this class I will normally have any
command-line argument parsing/functionality so that I can just have this
part done with before the rest of the app loads (forms).
But that's just me :)
HTH,
Mythran
Jeremy,
I think it's a good idea. It provides a logical place to put entry
point code. I have since started adopting the convention for 1.1
application as well. I often tinker around with the code inside the
Main method like choosing to run the application as a windows service
or winform application, processing command line arguments, etc.
Brian
Jeremy wrote:
I'm finally getting up to speed on VS 2005 and see that there is now a class
named Program that contains the main entry point for Windows Forms
applications. Yes, I understand that this is something that VS creates for
us and that we are not *required* to use it as is.
My question:
Are many of you who are writing non trivial Windows Forms applications
keeping this Program.cs file as generated by VS? Are you using it "as is" or
do you throw other things in there? If so, what else do you add to
Program.cs?
(just wondering what most developers think of this change and how you are
using it).
Thanks.
Yup, except I added a bunch to it, like throwing up a splash screen,
loading some initail data from the database and kicking off some
background threads, all before I show the main form.
When the form closes, it then cleans everything up.
Andy
Jeremy wrote:
I'm finally getting up to speed on VS 2005 and see that there is now a class
named Program that contains the main entry point for Windows Forms
applications. Yes, I understand that this is something that VS creates for
us and that we are not *required* to use it as is.
My question:
Are many of you who are writing non trivial Windows Forms applications
keeping this Program.cs file as generated by VS? Are you using it "as is" or
do you throw other things in there? If so, what else do you add to
Program.cs?
(just wondering what most developers think of this change and how you are
using it).
Thanks.
BTW, this is just like the project file in Delphi (dpr).
It is a good clean way to start off and perform
application initialization and precondition checks.
Roger This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike |
last post by:
I am sure that I am making a simple boneheaded mistake and I would
appreciate your help in spotting in. I have just installed
apache_2.0.53-win32-x86-no_ssl.exe
php-5.0.3-Win32.zip...
|
by: edgrsprj |
last post by:
PROPOSED EARTHQUAKE FORECASTING
COMPUTER PROGRAM DEVELOPMENT EFFORT
Posted July 11, 2005
My main earthquake forecasting Web page is:
http://www.freewebz.com/eq-forecasting/Data.html
...
|
by: Tom Lee |
last post by:
Hi,
I'm new to .NET 2003 compiler. When I tried to compile my
program using DEBUG mode, I got the following errors in the
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
\include\xdebug...
|
by: christopher diggins |
last post by:
I am wondering if any can point me to any open-source library with program
objects for C++ like there is in Java? I would like to be able to write
things like
MyProgram1 >> MyProgram2 >>...
|
by: Eric Whittaker |
last post by:
hi all,
im trying to write my first c++ program. a success, but i can't get the
window to stay open after user enters input. it just automatically closes.
right now the end of my program looks...
|
by: Hemal |
last post by:
Hi All,
I need to know the memory required by a c program. Is there any
tool/utility which can give me the memory usage in terms of DATA
segment, TEXT segment, BSS segment etc.
I am working...
|
by: ibtc209 |
last post by:
I just started programming in C, and I need some help with this problem.
Your program will read the information about one MiniPoker hand, namely the rank and suit of the hand’s
first card, and...
|
by: Banfa |
last post by:
Posted by Banfa
The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how...
|
by: amitpatel66 |
last post by:
There is always a requirement that in Oracle Applications, the Concurrent Program need to be execute programatically based on certain conditions/validations:
Concurrent programs can be executed...
|
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
|
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...
|
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...
|
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...
|
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,...
|
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: 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |