By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,184 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,184 IT Pros & Developers. It's quick & easy.

Windows Forms Generated Code vs .Designer.vb

P: n/a
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
Nov 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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


Nov 23 '05 #2

P: n/a
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

"Fredrik Melin" wrote:
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

Nov 23 '05 #3

P: n/a
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
"Fredrik Melin" <me*@no-spam.dacsa-remove-this.net> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
| 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
|
|
Nov 23 '05 #4

P: n/a
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.

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:%2****************@tk2msftngp13.phx.gbl...
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
"Fredrik Melin" <me*@no-spam.dacsa-remove-this.net> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
| 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
|
|

Nov 23 '05 #5

P: n/a
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
"Fredrik Melin" <me*@n.o.spam.dacsa.net.remove.as.needed> wrote in message
news:ug**************@tk2msftngp13.phx.gbl...
| 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.
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
| message news:%2****************@tk2msftngp13.phx.gbl...
| > 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
| >
| >
| > "Fredrik Melin" <me*@no-spam.dacsa-remove-this.net> wrote in message
| > news:Oi**************@TK2MSFTNGP10.phx.gbl...
| > | 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
| > |
| > |
| >
| >
|
|
Nov 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.