Partial Class Getting Extra Designer Form

  • Thread starter Thread starter Gary Brown
  • Start date Start date
G

Gary Brown

Hi,

I have moved some of the implementation of a form into a second
file and enclosed it with "partial class ..." VS wants to give the
second file its own designer form. How do I prevent that and how
do I get rid of the second one?

Thanks,
Gary
 
"Gary Brown"
I have moved some of the implementation of a form into a second
file and enclosed it with "partial class ..." VS wants to give the
second file its own designer form. How do I prevent that and how
do I get rid of the second one?

I should have added that I started with a blank code file for the second
implementation file.
 
Not sure how to prevent VS to display the blank designer form, but you can
manually modify the project file for your partial class to include the
following node:
<DependentUpon>MyFormFileName.cs</DependentUpon>
(or vb) - this way when you open your project, the partial class appears
under your form, sumilar to Designer class. You will still need to open with
View-Code rather then double-clicking though.

If anyone knows how to let VS know that the new partial definition should
NOT have a separate (blank) designer, or at least how to define default
opening action on it as code view - would appreciate a lot.
 

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

Back
Top