Hi!
I converted two old, rather big C# applications from VS2003 to VS2005. The new versions do not split my “forms” into “forms.Designer.cs” and “forms[Designer].cs” / “forms.cs”.
It seams to me, I’ve got a spaghetti code: an automatic generated part and user developing part of code together in one file.
As a result, it takes much moooore time to jump between the code and the form (layout), on the one hand, and contributes to get more “fragile” code with the automatic generating (VS2005 can refuse to design the forms if some errors happened appear in the user developing code), on the other.
One thing more, the “forms” are complex (they include tabControl etc.) and you have to jump from one tab to another to reach the developing part / code (the designer generats an initial view of the forms: page 0 when you switch between forms and a code).
Does anybody can recommend me how to split existing code into “forms [Designer].cs” / “forms.cs” and “forms.Designer.cs”.
Can I apply some automatical reconstruction (for ex.: by recompilation with some options) or should I make it “by hands” by means of partial classes
Best regards, AFT

VS2005 Hidden Designer code
Neelima
Hi Cleo!
Thanks for your attention. The problem is still unsolved because I have a shortage of time (it's much other things to be done). To recreate a new UI from the very beginning (tips I’ve got) doesn’t suit me because I’m responsible for two systems with only auto generated UI code exceeds 3000 lines each.
By the way, it seems to me now that the described spaghetti code ( not split “forms” into “forms.Designer.cs” and “forms[Designer].cs” / “forms.cs”.) contributes some others "side-by" effects.
One of them is described in a forum see: ” VS 2005 (Team Ed. for SD) C# disappearing of eventhandler delegates
” and another “VS 2005 (Team Ed. for SD) C# Windows.Forms.TabControl”Regards
AFT
MoonKoot
I had same problems. You can create new forms in VS2005 and copy/paste in them content (works for simple forms only) or you can create new form in VS2005 and then manually separate source - format in *.Designer.cs is not hard to understand.
Yeah, I agree with you - MS could take a little time on automatic conversion tool.
Cordell Lawrence
A little offtopic question, but you mention product feedback site. I have trouble accessing it (.NET passport not working, even no good error message) and when I try to access this passport support I get same cyclic error pages. This is strange, because I wiped out whole IE cache, cookies, history and it doesn't help. Also .NET Passport works fine on all other sites and if I switch to Guest user - I can get access to feedback site even with this passport. If you know where I should search and what I should clear to make it works - let me know please :)
neoonwheels
Hi AFT,
Thanks for your creative ideas to make VS studio easier to use for developers. I'm afraid this version of VS IDE cannot support based on your requirements, though the conversion from VS2002/2003 to 2005 really make some changes of solution and project settings and configurations which means "project" is the smallest unit of conversion. You can create a new solution with an empty project under 2005 and add existing files of your old 2002/2003 project correspondingly, and then you can find it work alright, which also proves the conversion unit is project.
Till now, there's no option for automatically split system generated from the whole code. Your comments and feedback could be highly valued, if you can report your ideas on our feedback website:
http://lab.msdn.microsoft.com/ProductFeedback/
Besides, it's also advisible to splitter different TabPages in one TabControl. We can clearly understand your concern and suppose it can be suitable to some extent of developers, while others may not need the splitting. It's recommended to specify your own code generator throught CodeDOM:
http://www.ondotnet.com/pub/a/dotnet/2003/02/03/codedom.html
We sincerely hope it helps and very much value your comments and look forward to further feedback from you. Please feel free to ask if you have any questions.
Best regards,
Cleo
RobertJe
update: I finally somehow find page in passport.net from MSN to get message send to them. Hope they will be able to solve this strange effect.
nav13
Hi S.G.,
Good to hear that. I sincerely hope the problem solved and like to have your exp. shared with us.
Regards,
Cleo
carlsnilsson
Did you consider to exclude this forms from project, copy in temp folder, then create new forms using "Add Windows Form" (now you have 2 source files) and then simply copy/paste from temp folder files (old files) to new I think even 3000 lines of code can be copy/pasted in five minutes.
Superman
In short - designer store everything in source text.
Tammy*
Hi S.G.,
Try steps that might help:
control panel->user accounts->advance>managed
Delete accounts information related .NET Passport.
If you still cannot figure out, please contact www.passport.net for support.
Cheers,
Cleo
MMerchant
Hi AFT,
How does your project go Have you resolved your problem
Looking forward to your further improvement.
Regards,
Cleo
TomLake
Hi AFT,
How does your project go Have you resolved your problem
Looking forward to your further improvement.
Regards,
Cleo
Christopher D
Hi S.G.
You're so welcome!
Regards,
Cleo
the test guy
Hej Sergej!
Many thanks for your help. Actually it was not so difficult as I thought before - I've already done this job. Your suggestion is rather elegant, isn't it But my question is: how did you paste a form from the temp one Do all events pasted too
I did it the following way:
1. Create a new form(s) and paste on it (them) the existing one(s) (for ex: Ctrl-A, Ctrl-s ->to get an existing form into buffer and then paste it on a new form: be sure that the size of a new form is not less than the original one).
2. Substitute all “#region (Windows Form Designer generated code)” on a new file with the origin one to be sure that all events are taken with.
Best regards
AFT
NewToC#47259
it still not working, something really strange, cleaning whole cookie, cache and passwords works for first time, but then all started again. But anyway thanks for care!
P. S. If you want you may contact me on Messenger by sgalich@rambler.ru - will be glad to see you.