473,785 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I get my VS2003 Form files splitted in 2 Partial class flies like in VS2005 ?

In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs and
Form1.resx.

In VS 2003 there is only one ".cs files".

How can I split my old VS2003 ".cs files" files in 2 files : From.cs and
Form.Designer.c s, and get thoses file "grouped" in the Solution explorer
under the main Form.cs file ?

Thanks for Help !

Steph.
May 11 '06 #1
9 3267
Hello TheSteph,

In no way, VS 2003 doesnt support this

T> In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs
T> and Form1.resx.
T>
T> In VS 2003 there is only one ".cs files".
T>
T> How can I split my old VS2003 ".cs files" files in 2 files : From.cs
T> and Form.Designer.c s, and get thoses file "grouped" in the Solution
T> explorer under the main Form.cs file ?
T>
T> Thanks for Help !
T>
T> Steph.
T>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 11 '06 #2
Hi,

You cannot, that is a new feature of VS 2005
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"TheSteph" <Th******@NoSpa m.com> wrote in message
news:Ol******** ******@TK2MSFTN GP02.phx.gbl...
In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs and
Form1.resx.

In VS 2003 there is only one ".cs files".

How can I split my old VS2003 ".cs files" files in 2 files : From.cs and
Form.Designer.c s, and get thoses file "grouped" in the Solution explorer
under the main Form.cs file ?

Thanks for Help !

Steph.

May 11 '06 #3
In fact I have imported in VS2005 a project that I began with VS2003. But
after Importing my project in VS2005, the Form files have not been split by
the "Import/Conversion wizard", and I would like to know if It is possible
to do it in automated way ? (I have +/- 50 Forms to convert.)

I have tried manually, it works BUT the Solution Explorer show the
From.Designer.c s files at the same level than the Form.cs. (the
Form.Designer.c s files should be a child of the Form.cs node and I don't
know how to do it.)

Thanks !

Steph.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:u4******** ******@TK2MSFTN GP05.phx.gbl...
Hi,

You cannot, that is a new feature of VS 2005
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"TheSteph" <Th******@NoSpa m.com> wrote in message
news:Ol******** ******@TK2MSFTN GP02.phx.gbl...
In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs and
Form1.resx.

In VS 2003 there is only one ".cs files".

How can I split my old VS2003 ".cs files" files in 2 files : From.cs and Form.Designer.c s, and get thoses file "grouped" in the Solution explorer
under the main Form.cs file ?

Thanks for Help !

Steph.


May 11 '06 #4
Steph,
What you are referring to is "Partial Classes" which is strictly a .NET 2.0
Framework feature. Since Visual Studio 2003 cannot target the 2.0 framework,
you are out of luck.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"TheSteph" wrote:
In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs and
Form1.resx.

In VS 2003 there is only one ".cs files".

How can I split my old VS2003 ".cs files" files in 2 files : From.cs and
Form.Designer.c s, and get thoses file "grouped" in the Solution explorer
under the main Form.cs file ?

Thanks for Help !

Steph.

May 11 '06 #5
Hi,

"TheSteph" <Th******@NoSpa m.com> wrote in message
news:ue******** ******@TK2MSFTN GP05.phx.gbl...
In fact I have imported in VS2005 a project that I began with VS2003. But
after Importing my project in VS2005, the Form files have not been split
by
the "Import/Conversion wizard", and I would like to know if It is possible
to do it in automated way ? (I have +/- 50 Forms to convert.)

No idea really, what you could try is open one of the forms in the designer
and see what happen, IMO it will not work though.
May 11 '06 #6
Steph,

There is no reason why it would split it apart. The code that you have
in .NET 1.1 is going to compile in .NET 2.0 (at least, for the most part).

The feature you are looking at is partial classes, which allows you to
separate a class definition into multiple files. The VS.NET people are
using this all over to separate the designer generated stuff from your
stuff.

Because it is not a requirement to use partial classes, the conversion
program doesn't touch it (since it isn't broke).

You might be able to get away with writing an app which will use CodeDOM
to parse your file, and then split it into two separate files, placing the
field declarations in one, and methods (except for InitializeCompo nent) in
another. In the end, it will not be easy though, since you can declare
fields anywhere in partial classes (and how do you know what you added, and
what was added previously by the designer).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"TheSteph" <Th******@NoSpa m.com> wrote in message
news:ue******** ******@TK2MSFTN GP05.phx.gbl...
In fact I have imported in VS2005 a project that I began with VS2003. But
after Importing my project in VS2005, the Form files have not been split
by
the "Import/Conversion wizard", and I would like to know if It is possible
to do it in automated way ? (I have +/- 50 Forms to convert.)

I have tried manually, it works BUT the Solution Explorer show the
From.Designer.c s files at the same level than the Form.cs. (the
Form.Designer.c s files should be a child of the Form.cs node and I don't
know how to do it.)

Thanks !

Steph.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
wrote
in message news:u4******** ******@TK2MSFTN GP05.phx.gbl...
Hi,

You cannot, that is a new feature of VS 2005
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"TheSteph" <Th******@NoSpa m.com> wrote in message
news:Ol******** ******@TK2MSFTN GP02.phx.gbl...
> In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs and
> Form1.resx.
>
> In VS 2003 there is only one ".cs files".
>
>
>
> How can I split my old VS2003 ".cs files" files in 2 files : From.cs and > Form.Designer.c s, and get thoses file "grouped" in the Solution
> explorer
> under the main Form.cs file ?
>
>
>
> Thanks for Help !
>
>
>
> Steph.
>
>



May 11 '06 #7


OK. I Googled a bit and It seems that there is no tool to do that
automatically.. .

I found the solution to manually get it working right, I share to anyone
interested :

1.. Have a model of a simple "Form.Designer. cs" file and follow the model.
2.. Copy the Form.cs file and rename the copy 'Form.Designer. cs"
3.. The 2 main tricks are here :
- Do NOT work on this "INSIDE" the SOLUTION or the project. It will works
but the "Form.Design.cs " files will not go under the Form.cs node in the
Solution explorer. You can use VS2005, but open only the .cs files you are
working on !

- "Form.Designer. cs" have natively no "using" clause : so you have to insert
the full path in front of the component that are in the Form : example :

private StatusBar StbMain;

will be replaced by :

private System.Windows. Forms.StatusBar StbMain;

- Once you finished working on the files. Close them. Open the
solution. The Form.Designer.c s file will be under the right Form.cs node,
but the designer.cs files are "grayed" and with a "white" icon. Just
Right-cLick the designer.cs files and select "Add File to Project"; the file
will be no more grayed and with the right Icon.

That's it....



Well... 49 files remainning...

Thanks !

Steph.

"TheSteph" <Th******@NoSpa m.com> wrote in message
news:Ol******** ******@TK2MSFTN GP02.phx.gbl...
In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs and
Form1.resx.

In VS 2003 there is only one ".cs files".

How can I split my old VS2003 ".cs files" files in 2 files : From.cs and
Form.Designer.c s, and get thoses file "grouped" in the Solution explorer
under the main Form.cs file ?

Thanks for Help !

Steph.

May 11 '06 #8


OK. I Googled a bit and It seems that there is no tool to do that
automatically.. .

I found the solution to manually get it working right, I share to anyone
interested :

1.. Have a model of a simple "Form.Designer. cs" file and follow the model.
2.. Copy the Form.cs file and rename the copy 'Form.Designer. cs"
3.. The 2 main tricks are here :
- Do NOT work on this "INSIDE" the SOLUTION or the project. It will works
but the "Form.Design.cs " files will not go under the Form.cs node in the
Solution explorer. You can use VS2005, but open only the .cs files you are
working on !

- "Form.Designer. cs" have natively no "using" clause : so you have to insert
the full path in front of the component that are in the Form : example :

private StatusBar StbMain;

will be replaced by :

private System.Windows. Forms.StatusBar StbMain;

- Once you finished working on the files. Close them. Open the
solution. The Form.Designer.c s file will be under the right Form.cs node,
but the designer.cs files are "grayed" and with a "white" icon. Just
Right-cLick the designer.cs files and select "Add File to Project"; the file
will be no more grayed and with the right Icon.

That's it....



Well... 49 files remainning...

Thanks !

Steph.

"TheSteph" <Th******@NoSpa m.com> wrote in message
news:Ol******** ******@TK2MSFTN GP02.phx.gbl...
In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer. cs and
Form1.resx.

In VS 2003 there is only one ".cs files".

How can I split my old VS2003 ".cs files" files in 2 files : From.cs and
Form.Designer.c s, and get thoses file "grouped" in the Solution explorer
under the main Form.cs file ?

Thanks for Help !

Steph.

May 11 '06 #9
Take a look at this site:
http://webproject.scottgu.com/CSharp...migration.aspx

He's got a complete walkthrough for migrating 2003 projects to 2005 and
includes a description of how to convert the project to use partial
classes. While the created files might need some tweaking, it seems a
heck of a lot easier than doing it all by hand.

--Faulk

*** Sent via Developersdex http://www.developersdex.com ***
May 19 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1364
by: -DG- | last post by:
In C++, there is a compelling reason to recreate projects for the VS2005 compiler rather than simply copy and recompile older code (reason being C++/CLI syntax). I'm wondering if there is any reason to do the same with C# code. Does a newly created project have any differences in compiler switches when compared to a ported VS2003 project?
2
2778
by: -DG- | last post by:
No reply on my previous query, so I'll post this again. I've done a bit more research in the interim. I'm trying to find an easy way to port code from the older VS2003 format to the format used in VS2005. VS2005 uses partial classes to split off the compiler-generated sections of forms. It keeps the editable files uncluttered. I generated very simple projects with VS2003 and with VS2005 to compare the output. Following are...
10
3074
by: chris | last post by:
I'm not sure if this is a bug being caused by visual studio, or by the vb compiler itself. I have good size solution (33 projects) and am consistently having a problem with one project.. Basically everytime I build, I get the compiler error bc30456...which is basically that some local variable is not declared. However, the variable is declared...and basically if I change its declaration from private to protected the project will...
15
4232
by: Joseph Geretz | last post by:
OK, I'll admit it up front - I just don't get it. Here's our previous VS2003 development model. Developers develop the WS solution on their own workstations, using their own IIS web servers mapped to the local devleopment folder. Project compiles to a subfolder .\bin. To deploy, the asmx page and bin subfolder are copied to the production server. So now I upgrade to VS2005. OK, so except for the name, everything is changed. No more...
2
5715
by: Tammam | last post by:
Hello All, I had a solution composed of managed/unmanaged C++ , C# projects. It builds with no problem in VS2003 but after converting the solution to VS2005 i get many linking errors such as LNK2020 LNK2028. Below is a little bit of the error report. Error 34 error LNK2020: unresolved token (0A000029) "public: __thiscall std::_Container_base::_Container_base(void)" (??0_Container_base@std@@$$FQAE@XZ) UnmanagedResiprocateController.obj
5
2229
by: Tony | last post by:
Hi all, Here's the link to the issue we were seeing on our ASP.NET system when modifying, adding and deleting directories in framework 2.0. http://blogs.msdn.com/toddca/archive/2005/12/01/499144.aspx I then tried a few of solution I found while perusing Google, - FCNMode registry mod - Relocating to App_Data folder to create/modify/delete directories.
13
1381
by: active | last post by:
With VS2005 the windows form designer uses the files *.Designer.vb I hope no one at MS is reading this because I know it will upset them to know - I like the old way better! I've been looking at the Options available for the Windows Form Designer and do not see one that would give me the older method. Is there such an option?
3
2411
by: Academia | last post by:
I have a vs2003 project (actually 44 of them) that I want to convert to VS2005 format. To fix a usercontrol file I created the Designer.vb file and moved the Inherited and Class ( change to partial class) lines to it so it started with: <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()_ Partial Class UserControl1
2
2128
by: Peted | last post by:
Hi, im moving a project from vs2005 to vs 2008. is doing so i have come across a compiler error regarding partial classes that i dont understand if anyone can explain it to me please the orig defintion that compiles and runs fine in vs2005 is bellow......
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8972
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.