Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Winform without DOS Console
Message
De
26/12/2007 10:51:46
 
 
À
26/12/2007 10:11:06
Irv Adams
MSC Managed Care, Inc.
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01277495
Message ID:
01277529
Vues:
12
Irv,

In .NET 1.1, we didn't have partial classes (that's new to 2.0) ... all that designer-generated code that is now put into a separate MyForm.designer.cs file, with 1.1 it was all put into the same file (MyForm.cs) that you had to do all of your own code in. It was ok, because .NET put it all into a #region, so you didn't have to look at it if you didn't want/need to.

We have ported our old 1.1 app to 2.0, and left all that designer-generated code in the MyForm.cs file. It works fine under 2.0, so why change it? <g> Any new Forms we create, we let VS do it the way it wants to and keep the MyForm.designer.cs files.

Partial classes are nice. It makes things simpler to have that designer-generated stuff stuck elsewhere, so it doesn't clutter up my file with code I didn't write. You can still look at the designer.cs file to see how it works ... you don't need to stick it all in your code file to see it in action.

~~Bonnie




>>>I've created an Empty Winform project in C#.NET with just a Windows Form component. I am trying to put all the code in one file instead of having a partial class, etc. Everything works fine and my Form displays as desired, but I also get a Console (DOS) window along with my Winform.
>>>
>>>I can go to the Properties tabs and set it for a Windows Application output type, run it and the DOS window is gone; however, I was wondering if there's a way in code to declare the same thing, a switch or something.
>>>
>>>Thanks,
>>
>>I don't know how to solve your problem, but why are you trying to to put all of the code in one file?
>
>No specific reason other than to see how all the support commands work, the stuff that .NET puts in Designer.cs; just curiosity, really.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform