![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Sep 2004
Posts: 50
Rep Power: 5
![]() |
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. |
|
|
|
|
|
#2 |
|
Expert Programmer
|
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.
|
|
|
|
|
|
#3 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
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.
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Apr 2005
Posts: 32
Rep Power: 0
![]() |
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());
}
}
}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 |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Sep 2007
Posts: 1
Rep Power: 0
![]() |
im just new here.. i just want to know how to attach a data base file to Visual Basic... tnx
|
|
|
|
|
|
#7 |
|
Expert Programmer
|
May i suggest creating your own topic first?
__________________
|
|
|
|
|
|
#8 | |
|
SEXY SHOELESS GOD OF WAR!
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,198
Rep Power: 5
![]() |
Quote:
__________________
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 |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |