Solved

VS 2005 Disappearing Namespace Region

Posted on 2006-11-01
3
245 Views
Last Modified: 2010-04-23
I'm trying to settle into using VS2005 coming from VS2003 (yes, I know I'm late).  I've noticed that no matter what I try, I cannot get access to that specific region in any VB.NET form (or ASP.NET page for that matter) where the controls are declared private, protected, public, withevents, etc.  This area also gives me access to making any changes to the namespace that I wish.  Can someone tell me exactly how to bring this region back into view?  The reason I ask is that I had an image button yesterday that somehow got pooched and I could not build the form because VS kept telling me "WithEvents" was not declared.  I ended up having to remove the button, save and close the project, reopen the project and add the button again.  Annoying!  Thanks!
0
Comment
Question by:Mister Porsche GT3
3 Comments
 
LVL 34

Accepted Solution

by:
Sancler earned 75 total points
Comment Utility
In Solution Explorer, click Show All Files.  On tree, click "+" by form concerned.  Double-click on <formname>.Designer.vb

Roger
0
 
LVL 6

Assisted Solution

by:Jayadev Nair
Jayadev Nair earned 50 total points
Comment Utility
Hi

Like 2003, Windows generated code is not in a specific region inside yourCode.vb. Instead it is in another file which is declared as a Partial Class of a your original Class. Partial Class is a new feature in 2005 and it is very helpful to divide and place your code in several files writing

Public Partial Class MyCode

End Class

So, to find the region, look into YourCode.designer.vb file which will be right in the directory where your actual form class exists. In visual studio, if you donot find that file - Click Show Hidden Files option on top of solution explorer dock window. This will show a + symbol on your form. Expand it and there you will find designer.vb file and also .resx of your form. In 2005, a form class will have three files. Form1.VB (where you code), Form1.designer.vb(designer code) and Form1.resx (your resources). But please be careful while editing the designer code. :)

Thanks.
0
 

Author Comment

by:Mister Porsche GT3
Comment Utility
Cool, that worked for VB.  I am having a problem replicating that result in ASP.NET -- is it something close?  The "show all files" in ASP is grayed out.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

10 Experts available now in Live!

Get 1:1 Help Now