Solved

partial class c#

Posted on 2011-03-23
3
537 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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now