简体   繁体   English

如何在Visual Studio(C#)中找到表单上的控件

[英]How can I find my controls on the form in Visual Studio (C#)

I have a form which I have created in Visual Studio and there are some controls on there with strange names which have events associated with them. 我有一个我在Visual Studio中创建的表单,并且有一些控件在那里有奇怪的名称,这些名称都有与之关联的事件。 I think the controls have been added in error. 我认为控件添加错误。 They are labels. 它们是标签。 I can't see them on the form, they must have no text or be behind something. 我不能在表格上看到它们,它们必须没有文字或背后的东西。 How can I find them? 我怎么才能找到它们?

Use the View + (Other Windows) + Document Outline menu command. 使用View +(Other Windows)+ Document Outline菜单命令。 You'll get a tool window that displays all the children of the form. 您将获得一个工具窗口,显示表单的所有子项。 You can drag+drop a control up to its container to put it on top of the Z-order, in case such a label is covered by another control. 您可以将控件拖放到其容器中以将其置于Z顺序之上,以防此类标签被另一个控件覆盖。 Or right-click a rogue one and select Delete. 或者右键单击流氓并选择“删除”。 Edit + Undo if you made a mistake. 如果您犯了错误,请编辑+撤消。

  1. Display the Properties window. 显示“属性”窗口。 (Use View, Properties Window if it is not already displayed.) (如果尚未显示,请使用“视图”,“属性”窗口。)

  2. In the dropdown at the top of the Properties window, select the control that is giving you problems. 在“属性”窗口顶部的下拉列表中,选择给您带来问题的控件。

  3. Change the Location to 0,0. 将位置更改为0,0。

  4. The control should now be at the top-left corner of your form, so that you can delete it. 控件现在应位于表单的左上角,以便您可以将其删除。

  5. If you can't see it, click in the white area outside of your form. 如果看不到,请单击表单外的白色区域。 Then the Format menu will appear from which you can pick Order, Bring to Front. 然后将出现格式菜单,您可以从中选择订单,置于前面。

Copied from here 这里复制

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么在Visual C#2008 Studio中找不到Var关键字? - Why can't I find the Var keyword in my Visual C# 2008 Studio? 调整控件以匹配 Visual Studio C# 2019 中的表单调整大小? - Adjust controls to match form resize in Visual Studio C# 2019? C#:如何在Windows应用程序中的Win窗体上自由移动控件? - C#: How can I move my controls on a win form in windows application freely? 我如何在代码中检查是否选中了我的 DataGridView 复选框。 c# 视觉工作室 Windows 窗体 - How do I in code check that my DataGridView checkbox is selected. c# visual studio Windows form 当我将 Metro 框架用于 c# 时,如何导航到 Visual Studio 中的下一个表单? - How can I navigate to next form in Visual studio when I'm using metro framework for c#? 如何找出我在Visual Studio 2017中使用的c#项目类型? - How can I find out what type of c# project I'm using in Visual Studio 2017? 如何在Windows窗体中将.png文件用作按钮? (在C#中 - visual studio 2013) - How can I use a .png file as a button in Windows Form ? ( in C# - visual studio 2013 ) 如何在 Visual Studio C# 中创建表单实例? - How do I create an instance of a form in Visual Studio C#? 在 Visual Studio 2008 中单步执行 C# 时如何找到方法调用者? - How can I find a method caller when stepping through C# in Visual Studio 2008? 如何向 C# 中的控件添加移动效果? - How can I add moving effects to my controls in C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM