Windows Forms Generated Code vs .Designer.vb

F

Fredrik Melin

2005 uses the Partial Class & <form>.Designer.vb for its "windows forms
generated code"

Anyone know if its faster/better then old 2003 way?

Also, when upgrading a 2003 project it did not change that, it left it the
"old way", is there a easy way to split them up or do I have to do it
manually If I want to do it?

Regards
Fredrik
 
C

Cor Ligthert [MVP]

Frederik,
Anyone know if its faster/better then old 2003 way?
It is not faster/better, it is easier to handle. The partial class is still
a part of the complete class.

However I like it more.
Also, when upgrading a 2003 project it did not change that, it left it the
"old way", is there a easy way to split them up or do I have to do it
manually If I want to do it?
I don't know yet however I would be very surprised as you see how you can
interfere in the by the designer created code by instance adding overloaded
subs New.

I do it on what you call manually by copying and pasting, while I have not
found yet what is the method I like the most.

Cor
 
G

Guest

VB 2005 has gone back to the "magic behind the scenes" approach of VB6. For
instance, you might wonder why a new VB 2005 form doesn't have a (visible)
constructor and nowhere will you find a (visible) call to the hidden
constructor.

Also, you might wonder why the access modifiers are different on the two
portions of the partial form class (can it be instantiated from outside the
project or not...?).

Anyway, to answer your main questions, it's not faster and it's fine to
leave it the "old way".

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
 
J

Jay B. Harlow [MVP - Outlook]

Fredrik,
In addition to the other comments.

One reason its "better" then the old 2003 way in that a developer has little
or no chance of accidentally changing the designer generated code. As you
have to show hidden files, expand the Form's node in solution explorer, open
the designer.vb file... Yes it can be done, just takes more effort.

In ASP.NET projects its "better" as you're not dealing with the .aspx
inheriting from the .vb file any more, it simplifies some constructs
there...

I don't see that it is "faster" as a single class is still created.

I have manually moved the "Windows Forms Generated Code" to Designer.vb
files in a handful of projects I upgraded from 2003 to 2005. No real need
just seeing if one could do it. I normally create a new form in 2005 to see
what the code looks like & then cut & paste the 2003 code to match the
general layout of the 2005 code. VS seems to be none the wiser.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| 2005 uses the Partial Class & <form>.Designer.vb for its "windows forms
| generated code"
|
| Anyone know if its faster/better then old 2003 way?
|
| Also, when upgrading a 2003 project it did not change that, it left it the
| "old way", is there a easy way to split them up or do I have to do it
| manually If I want to do it?
|
| Regards
| Fredrik
|
|
 
F

Fredrik Melin

Ok, thanks.
I really like the "cleaner" look for day to day programming with the new
..Designer model.

just that my project is 233 forms, will take a while doing cut and paste,
but I take them as they come.
 
J

Jay B. Harlow [MVP - Outlook]

Fredrik,
| just that my project is 233 forms, will take a while doing cut and paste,
| but I take them as they come.
One might be able to create a macro and/or console program that does the
work for you.

If I have time later this weekend, maybe I will look at creating one...

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Ok, thanks.
| I really like the "cleaner" look for day to day programming with the new
| .Designer model.
|
| just that my project is 233 forms, will take a while doing cut and paste,
| but I take them as they come.
|
| message | > Fredrik,
| > In addition to the other comments.
| >
| > One reason its "better" then the old 2003 way in that a developer has
| > little
| > or no chance of accidentally changing the designer generated code. As
you
| > have to show hidden files, expand the Form's node in solution explorer,
| > open
| > the designer.vb file... Yes it can be done, just takes more effort.
| >
| > In ASP.NET projects its "better" as you're not dealing with the .aspx
| > inheriting from the .vb file any more, it simplifies some constructs
| > there...
| >
| > I don't see that it is "faster" as a single class is still created.
| >
| > I have manually moved the "Windows Forms Generated Code" to Designer.vb
| > files in a handful of projects I upgraded from 2003 to 2005. No real
need
| > just seeing if one could do it. I normally create a new form in 2005 to
| > see
| > what the code looks like & then cut & paste the 2003 code to match the
| > general layout of the 2005 code. VS seems to be none the wiser.
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > .NET Application Architect, Enthusiast, & Evangelist
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > | > | 2005 uses the Partial Class & <form>.Designer.vb for its "windows
forms
| > | generated code"
| > |
| > | Anyone know if its faster/better then old 2003 way?
| > |
| > | Also, when upgrading a 2003 project it did not change that, it left it
| > the
| > | "old way", is there a easy way to split them up or do I have to do it
| > | manually If I want to do it?
| > |
| > | Regards
| > | Fredrik
| > |
| > |
| >
| >
|
|
 

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