开发者

View Designer Code in Visual Studio 2010

What is a standard way to open the Designer (automatically generated) code for a VB file?

As a workaro开发者_JAVA技巧und, I can get to it by searching the entire solution for some keyword that is usually only found in those files: Global, Partial, etc.


Open the Solution Explorer. Along the toolbar at the top there is a tool Show All Files (it is the 2nd from the left on my version of visual studio). Click on that tool. All of your Form files will now have an arrow beside them. click on that arrow to expand. Look for the code file named FormName.designer.vb. Double-click on it to open.

View Designer Code in Visual Studio 2010


You have to click the "show all files"-Button. Then you can also see the Designer.vb-files.

View Designer Code in Visual Studio 2010

Note: For C# and VS 2008, but the same applies to VB in VS 2010.

  • http://peterkellner.net/2007/12/31/visualstudioshowallfiles/
  • http://blog.brianhartsock.com/2009/09/14/visual-studio-tip-show-all-file/
  • Keyboard shortcut for Show All Files

Show All Files is a useful little button in the Visual Studio solution explorer to give us a full view of the directory structure our project files are sitting in. When it is off, we only see the files that are explicitly included in the project, but when it is on, we see everything. This makes it very easy to explicitly opt a file into the project without doing an add -> existing item -> find existing item in directory structure and add to project.

The default when creating a new Visual Basic application in Visual Studio is to not show all files, and unfortunatly there is no setting you can adjust to change that.


Open the code file, and in the top-right corner of the code window is a drop-down containing all methods. Open this and select "InitializeComponent".


A screenshot from a newer version. Visual Studio 2015 and 2017 will look like this.

View Designer Code in Visual Studio 2010

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜