View Designer Code in Visual Studio 2010

2019-01-25 08:47发布

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

As a workaround, I can get to it by searching the entire solution for some keyword that is usually only found in those files: Global, Partial, etc.

4条回答
Explosion°爆炸
2楼-- · 2019-01-25 09:19

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.

enter image description here

查看更多
霸刀☆藐视天下
3楼-- · 2019-01-25 09:23

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

enter image description here

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

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.

查看更多
看我几分像从前
4楼-- · 2019-01-25 09:23

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

enter image description here

查看更多
我欲成王,谁敢阻挡
5楼-- · 2019-01-25 09:29

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".

查看更多
登录 后发表回答