Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 1st, 2007, 5:31 PM   #1
Robocop
Programmer
 
Join Date: Sep 2004
Posts: 50
Rep Power: 5 Robocop is on a distinguished road
How to set startup form?

I tried going to Project > Properties, and then the Application tab, startup object, but the only choice is "Calculations.Program", and none of my forms are shown in there...

Thanks in advance.
Robocop is offline   Reply With Quote
Old Jul 1st, 2007, 7:20 PM   #2
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
Open the Calaculations.Program file. Should be named Program.cs. You'll see the startup form in there. You can then change it to whatever.
Booooze is offline   Reply With Quote
Old Jul 1st, 2007, 7:29 PM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
The template for a WinForms application was changed in 2.0

Previously, a default form was created under the name 'Form1.cs' which contained, among other things, a static Main method. Somewhere in the project properties, you set 'Form1' as your startup object. That means that the entry point is Form1.Main. This method is the your program's entry point.

In 2.0 this was changed. While you still get a template 'Form1' class, the entry point has moved in to the 'Program' class by default. It contains only one method -- Main. You cannot set the startup object to Form1 because it does not contain a static Main method with the right signature.

The solution is simple. The default Main method does most of its work in one method call. It calls Application.Run and passes it a Form object (by default expressed as 'new Form1()' ) Application.Run starts the message loop, and returns when the provided Form is closed. When Run returns, Main is over, and the program exits. Just change 'new Whatever()' to the desired startup form.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Jul 7th, 2007, 2:42 PM   #4
mattireland
Hobbyist Programmer
 
mattireland's Avatar
 
Join Date: Jul 2007
Location: Wales, United Kingdom
Posts: 210
Rep Power: 2 mattireland is on a distinguished road
Send a message via MSN to mattireland Send a message via Skype™ to mattireland
If your using Visual Studio 2005 you can right click on something like properties in the Document Tree and then select the form you want form the drop-down menu.
mattireland is offline   Reply With Quote
Old Aug 9th, 2007, 3:02 AM   #5
Bharathi
Programmer
 
Join Date: Apr 2005
Posts: 32
Rep Power: 0 Bharathi is on a distinguished road
Hi,

How to set the Startup form in C#

When the application starts up, the first form to be displayed, has to be specified in the Project properties window. In C#, in the ‘Startup object’ drop down list box, the MenuForm option will not be displayed. So, to set the ‘Startup object’, select the class that contains Main( ) in the Project Properties dialog box. To do this, create a class, name it finstart, and type the following:

using System;
using System.Collections.Generic;
using System.Text;
namespace FinCsharpProject
{    class FinStart
    {	static void Main()
        {		
          	System.Windows.Forms.Application.Run(new MenuForm());
        }
    }
}
Now, in the Startup object drop down list box of the properties dialog box, FinStart classs will be displayed. Choose this option. When we run the application, the MenuForm will be displayed at startup.


Database prgramming using Visual basic 2005 and Csharp 2005
http://www.vkinfotek.com

Last edited by big_k105; Aug 9th, 2007 at 10:16 AM. Reason: added Code tags
Bharathi is offline   Reply With Quote
Old Sep 1st, 2007, 1:14 AM   #6
Liearch
Newbie
 
Join Date: Sep 2007
Posts: 1
Rep Power: 0 Liearch is on a distinguished road
Question Hello...

im just new here.. i just want to know how to attach a data base file to Visual Basic... tnx
Liearch is offline   Reply With Quote
Old Sep 1st, 2007, 2:04 AM   #7
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 597
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Quote:
Originally Posted by Liearch View Post
im just new here.. i just want to know how to attach a data base file to Visual Basic... tnx
May i suggest creating your own topic first?
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old Sep 1st, 2007, 7:12 AM   #8
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,198
Rep Power: 5 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by Liearch
im just new here.. i just want to know how to attach a data base file to Visual Basic... tnx
You don't post an intro, you drag the lake for a dead thread, then you hijack that thread to ask your (totally unrelated, I might add) question? Don't be surprised if nobody helps.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FFT DWTIB -> Optimization -> Choosing An Appropriate Run Time Sane Software Design and Algorithms 7 Dec 1st, 2006 11:40 AM
Show or hiding forms/modifying control properties ..from different a form.. cloud- C# 4 Nov 10th, 2006 11:51 AM
Form Submit Blues MegaArcon Python 3 Dec 14th, 2005 5:20 PM
.NET Timer Form closing issue MBirchmeier C# 4 Nov 21st, 2005 11:00 AM
entering data into excel from a form glevine Perl 1 Nov 18th, 2005 6:03 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC