[英]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. 如果您犯了错误,请编辑+撤消。
Display the Properties window. 显示“属性”窗口。 (Use View, Properties Window if it is not already displayed.) (如果尚未显示,请使用“视图”,“属性”窗口。)
In the dropdown at the top of the Properties window, select the control that is giving you problems. 在“属性”窗口顶部的下拉列表中,选择给您带来问题的控件。
Change the Location to 0,0. 将位置更改为0,0。
The control should now be at the top-left corner of your form, so that you can delete it. 控件现在应位于表单的左上角,以便您可以将其删除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.