2005 vs. 2003

C

cj

In 2003 I had

Public Class Form1
Inherits System.Windows.Forms.Form

In 2005 I've seen it with and without the Inherits
System.Windows.Forms.Form. Is it supposed to be there? I'm wondering
if in my cutting and pasting I put it there in some of my 2005 programs
and it is not necessary.
 
R

Rory Becker

In 2003 I had
Public Class Form1
Inherits System.Windows.Forms.Form
In 2005 I've seen it with and without the Inherits
System.Windows.Forms.Form. Is it supposed to be there? I'm wondering
if in my cutting and pasting I put it there in some of my 2005
programs and it is not necessary.
In VS2005 we have a new feature called "Partial Classes". this feature allows
a class to be broken up amongst many files. In this case the generated code
for you form is in a file called Form1.designer.vb which is hidden by default.
Like the .res files

What you need to do to see this file is to hit the Show all files in the
solution explorer window, whilst your project is selected.
you will then be able to hit a + symbol next to your forms entry and this
file will appear.
 
C

cj

Thanks, when I looked at the files as you noted I also noticed the 2005
programs that show it were upgraded from 2003. The ones w/o are 2005
from scratch. I wish when it upgraded a 2003 program it didn't put the
windows form designer generated code section in form1.vb cause it keeps
wanting to expand it and when I do a find it search it. I've taken a
couple 2003 programs that were upgraded to 2005 and started them over in
2005 from scratch then cut code from subs and pasted them into 2005 but
a lot of menus etc names are a bit different and all that has to be
considered.
 
L

Linda Liu [MSFT]

Hi Cj,

VS05 introduces the definition of Partial class, and places the Windows
Forms Designer generated code in a seperate file, i.e. .Designer.vb.

When we upgrade a VS.NET 2003 project to VS05 project, the Windows Form
Designer generated code won't be separated into a .Designer.vb file.
Instead, all code remains the same as the VS.NET 2003 project.

In fact, I don't think it's necessary to change the structure of the
project, i.e. separate the Windows Forms Designer generated code into a
..Designer.vb file.
I've taken a couple 2003 programs that were upgraded to 2005 and started
them over in 2005 from scratch then cut code from subs and pasted them into
2005 but a lot of menus etc names are a bit different and all that has to
be considered.

Could you please tell me why you need to cut and paste the code from VS.NET
2003 project to VS05 project? Could you tell me what you mean by "a lot of
menus etc names are a bit different and all that has to be considered"?


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

cj

Hi Linda,

I got the answer I needed for this question but I don't mind explaining
if you want to know.

I don't like the Windows Forms Designer Generated code being placed in
form1.vb in a 2005 program. If I upgrade it is put there. However I
can start a new project and cut and paste the code for each sub over to
the new program. Of course I have to create the form in designer again.
Menu's have changed from 2003 to 2005. The old main menu is gone and
the new menu stip so I need to make sure everything is named
appropriately in the 2005 program so the code I'm cutting from the 2003
program will work in it.

Overall I'm happy upgrading works and works very well but it has things
that irritate me like not converting the 2003 Windows Forms Designer
Generated code to the new 2005 way of doing things.
 
L

Linda Liu [MSFT]

Hi Cj,

Thank you for your prompt response and detailed explanation.

I understand what you mean. Yes, Menu is replaced with MenuStrip in VS05,
but we could still use Menu in VS05 without any question.

As I have mentioned in my first reply, when a VS.NET 2003 project is
upgraded to a VS05 project, the code in the upgraded project will remain
the same as the VS.NET 2003 project.

I don't think it's a good idea to manually separate the Windows Forms
Designer generated code in the upgraded project into a .Designer.vb file. I
agree that you create a new VS05 project and copy the code in the VS.NET
2003 project into the new VS05 project. Of course, you need to create the
UI from scratch in the new VS05 project.

If you have any other question in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance!

Have a nice weekend!

Sincerely,
Linda Liu
Microsoft Online Community Support
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top