Link to home
Start Free TrialLog in
Avatar of khooc
khooc

asked on

Turn off separate Designer file for Forms/UserControls

Does anyone know how to turn off the separate .Designer file that VB.NET generates when you create a new Form/UserControl?

e.g.
frmMain.vb
 |- frmMain.Designer.vb

I actually prefer having it all in one file so I can make changes to the code quickly without having to expand the tree & open the file in Solution Explorer.

Chris
Avatar of newyuppie
newyuppie
Flag of Ecuador image

i think it was on 1 file in studio 2003. in 2005, it separates everything. actually you grow used to it, its cleaner to have the initialization code for the form apart from your main code.
Avatar of Kinger247
Kinger247

Are you asking how to hide the designer file ?

if so : Toggle the "Show All files" button located above the soltions explorer tree.

but then I think you already know that ?  
So what are you asking ?   :)
Avatar of khooc

ASKER

In 2003, they used to integrate the whole lot into one file.

Now the designer code is out of the way to a separate .Designer file via a partial class :-( which I don't particularly like.

I actually preferred it all in one file, which makes it easy for me to make designer code changes without having to 'Show All Files' and open the Designer file.

Chris
The thing is for people learning vb.net, the code which is commented as 'do not change' should not be with the user code.
But after a while I ended up changing the code there quite often.
VB 2005 designer supports forms developed in VB 2003. This means, you can manually copy designer-generated code from frmMain.Designer.vb to frmMain.vb - do this exactly like VB 2003 designer did. Then remove frmMain.Designer.vb file.
Avatar of khooc

ASKER

Hmm I was wishing there was a way it would do this automatically when I add a new form to the project. :-(
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of khooc

ASKER

Hi AlexFM

Hmm, I guess given the situation, you have answerd the question as best as can be answered - so you get the points.

Chris