Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / May 2004

Tip: Looking for answers? Try searching our database.

VB Form forgets it is one

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff Mason - 27 May 2004 18:14 GMT
I am using VS2003 and have a VB solution with several assemblies.  One of them
contains several forms and it seems that randomly, a few of those forms will "forget"
that they are forms and display in the solution view as though they were classes.  I
am unable to view them with the form designer, since VS apparently is convinced these
are classes and not forms.

If I inspect the project file "offline", I can see in the <files> section that the
subtype of the offending forms has been mysteriously changed to "Code".  If I
manually edit the project file and change this back to "Form" like the others in the
assembly, all appears well, at least for a while until the forms revert back.  It
seems that it is always the same few forms that exhibit this behavior.  I am unable
to say for certain what I may be doing that causes this - it appears to be random.

I also notice that if I do things like rebuild the solution, exit VS and re-enter and
then rebuild (sometimes more than once) the problem will also go away for a while,
but eventually it will return.

Anybody seen this behavior or have an explanation, and more importantly, a way to
make it stop doing this??

Thanks for any help...
Marc Bernard - 28 May 2004 17:45 GMT
> I am using VS2003 and have a VB solution with several assemblies.  One of them
> contains several forms and it seems that randomly, a few of those forms will "forget"
[quoted text clipped - 8 lines]
> seems that it is always the same few forms that exhibit this behavior.  I am unable
> to say for certain what I may be doing that causes this - it appears to be random.

I see this all the time in C# projects.  The culprit seems to be inherited
forms (and usercontrols).

The easiest way to fix this is to either edit the project file and change
"Code" to "Form" in the SubType, or you can try cutting and pasting the base
class name in the IDE.

For example, where you have:
public class MyClass : MyBaseClass

cut "MyBaseClass" and paste it right back.  I find this fixes the solution
explorer (and the project, I guess).

Marc

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.