Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 838
Paul Richards Avatar asked Sep 14 '14 15:09

Paul Richards


People also ask

How do I show controls in Visual Studio?

The Toolbox window displays controls that you can add to Visual Studio projects. To open Toolbox, choose View > Toolbox from the menu bar, or press Ctrl+Alt+X. You can drag and drop different controls onto the surface of the designer you are using, and resize and position the controls.

How do I find controls in C#?

FindControl("TextBoxID"); Or you may find this textbox directly inside the grid view row (if the textbox id is unique in the page) as follows: TextBox txt = (TextBox)gr. FindControl("TextBoxID");

How do you place the controls on a form?

Add the control by drawing Select the control by clicking on it. In your form, drag-select a region. The control will be placed to fit the size of the region you selected.


1 Answers

Use the View + (Other Windows) + Document Outline menu command. 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. Or right-click a rogue one and select Delete. Edit + Undo if you made a mistake.

like image 61
Hans Passant Avatar answered Oct 11 '22 19:10

Hans Passant