vb.net 在 Visual Studio 2010 中查看设计器代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7099694/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 15:39:30  来源:igfitidea点击:

View Designer Code in Visual Studio 2010

vb.netvisual-studiovisual-studio-2010

提问by Steven

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

打开 VB 文件的设计器(自动生成的)代码的标准方法是什么?

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.

作为一种解决方法,我可以通过在整个解决方案中搜索一些通常只在这些文件中找到的关键字来获得它:全局、部分等。

回答by briddums

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.

打开解决方案资源管理器。沿着顶部的工具栏有一个工具显示所有文件(它是我的 Visual Studio 版本的左起第二个)。单击该工具。现在,您的所有表单文件旁边都会有一个箭头。单击该箭头以展开。查找名为 FormName.designer.vb 的代码文件。双击它打开。

enter image description here

在此处输入图片说明

回答by Hand-E-Food

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

打开代码文件,在代码窗口的右上角是一个包含所有方法的下拉列表。打开它并选择“InitializeComponent”。

回答by Tim Schmelter

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

您必须单击“显示所有文件”按钮。然后您还可以看到 Designer.vb 文件。

enter image description here

在此处输入图片说明

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

注意:对于 C# 和 VS 2008,同样适用于 VS 2010 中的 VB。

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.

Show All Files 是 Visual Studio 解决方案资源管理器中的一个有用的小按钮,可以让我们全面了解我们的项目文件所在的目录结构。当它关闭时,我们只能看到明确包含在项目中的文件,但是当它打开时,我们看到了一切。这使得在不执行添加 -> 现有项目 -> 在目录结构中查找现有项目并添加到项目的情况下,显式地将文件选择到项目中变得非常容易。

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.

在 Visual Studio 中创建新的 Visual Basic 应用程序时的默认设置是不显示所有文件,不幸的是,没有可以调整的设置来更改它。

回答by Code Novice

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

来自较新版本的屏幕截图。Visual Studio 2015 和 2017 将如下所示。

enter image description here

在此处输入图片说明