Solved

VS 2005 Disappearing Namespace Region

Posted on 2006-11-01
3
253 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
ID: 17849828
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
ID: 17849832
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
ID: 17850696
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Database Connections Not being returned to Connection Pool 7 34
RLDC Reporting in Visual studio 11 30
vb.net class 3 22
Help with opening combobox using VB.NET. 3 26
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

831 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