Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows Forms Generated Code vs .Designer.vb

1 view
Skip to first unread message

Fredrik Melin

unread,
Nov 4, 2005, 3:41:28 AM11/4/05
to
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


Cor Ligthert [MVP]

unread,
Nov 4, 2005, 4:55:50 AM11/4/05
to
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


David Anton

unread,
Nov 4, 2005, 9:03:03 AM11/4/05
to
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

Jay B. Harlow [MVP - Outlook]

unread,
Nov 4, 2005, 11:59:17 AM11/4/05
to
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" <m...@no-spam.dacsa-remove-this.net> wrote in message
news:OiSGOuR4...@TK2MSFTNGP10.phx.gbl...

Fredrik Melin

unread,
Nov 4, 2005, 1:19:01 PM11/4/05
to
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]" <Jay_Har...@tsbradley.net> wrote in
message news:%23I$7aEW4F...@tk2msftngp13.phx.gbl...

Jay B. Harlow [MVP - Outlook]

unread,
Nov 4, 2005, 1:54:47 PM11/4/05
to
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" <m...@n.o.spam.dacsa.net.remove.as.needed> wrote in message
news:ugsy8wW4...@tk2msftngp13.phx.gbl...

0 new messages