Solved

partial class c#

Posted on 2011-03-23
3
540 Views
Last Modified: 2013-12-17
Hello,

As you see in attached picture, Visual C# 2008 by default create two partial classes for each Form (cs and Designer.cs). I added more partial classes for DB_Inserts.cs and DB_selects.cs but they are not displayed a chiled of the .cs Class but at the same level in Solution Explorer tree. How can I make additional partial classses shown as childs of the main class?
partial-classes.png
0
Comment
Question by:smetechit
3 Comments
 
LVL 8

Accepted Solution

by:
crysallus earned 125 total points
ID: 35204803
I haven't tried it (at least not yet, as I just found it), but you may want to look at VSCommands, which appears to add that functionality. Try it here:

http://vscommands.com

It looks like the 2008 version can be downloaded here.
0
 
LVL 13

Assisted Solution

by:gamarrojgq
gamarrojgq earned 125 total points
ID: 35211353
Hi,

VS does that only for form designers, but if you want to "cheat"  VS, you can name the second file .designer.vb, it is not pretty but it works

So your first class would be

SomeClass.vb (Public Class SomeClass)

Your second class would be

SomeClass.designer.vb (Partial Class SomeClass)

This will put the second class inside the Fistone like the designer for a forma does, but will only work once, so you only can have a parent and 1 child.

Hope that helps
0
 

Author Closing Comment

by:smetechit
ID: 35419113
There is no solution but I got two suggessions
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question