Paul Richards
Paul Richards

Reputation: 1207

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?

Upvotes: 19

Views: 12035

Answers (2)

Martin
Martin

Reputation: 3472

  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.

  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

Upvotes: 1

Hans Passant
Hans Passant

Reputation: 942408

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.

Upvotes: 36

Related Questions