How to search my design (form) for a hidden (lost) control?

Category: c# ide

Question

mihooper1 on Mon, 02 Feb 2009 20:16:56


I have managed to lose a radio button under several layers of panels and tab controls in my [design] form window. Is there a way to search the GUI for the missing control element?

Replies

Daniel Stafford on Mon, 02 Feb 2009 20:43:09


The Properties window has a dropdown that lists all of the elements on a designer view, so you should be able to select it from there.

mihooper1 on Mon, 02 Feb 2009 21:25:40


Daniel,

Thanks for the feedback. However, I'm not quite following you. When viewing the main user interface Form (mine is called MainUI.cs[Design]) window, the Properties window associated with that form does not appear to have a dropdown list of elements contained on the form. I can find various instances of the element (radioButton1) in several places in the MainUI.designer.cs, but I cannot visually see the element on the MainUI form. I would like to delete the rougue control so that I can re-use the name of the control (since much of my code already references it. I would prefer not to comb through the .designer code to manually delete all references to radoButton1.

Thanks!

Daniel Stafford on Mon, 02 Feb 2009 21:28:58


It should be right at the top of the Properties window, and all of my designer properties windows have it, so I'm not sure why yours would not.  If you do have to manually delete it, it should not be hard since there should only be references to it in 2 locations, one for the declaration and one for the initialization and placing.

mihooper1 on Mon, 02 Feb 2009 21:39:58


Daniel,

Yes, you are correct. My "designer" window does have a drop down properties box that lists all of the elements. I was looking for a way to search the GUI "Form" window for the missing control that is hidden under other elements.

Thanks!

Sheng Jiang 蒋晟 on Tue, 03 Feb 2009 01:27:25


Go ask or search in the Windows Form designer forum. If you like to add a feature to Visual Studio, go to connect.microsoft.com to send your feedback.

extreme_al on Sun, 02 Sep 2012 06:06:12


Given that this is 3 years old, it probably won't help the original poster, but I've had similar problems and eventually had to edit the <myform>.designer.cs file to manually delete the controls.  Make sure to back up everything first, obviously, and be prepared for VS to give you a bunch of error messages until you get rid of them all.  Then redraw the controls and give them their desired names.

--Al--

mihooper1 on Tue, 11 Sep 2012 19:10:01


Al,

I'm still hanging around.

" eventually had to edit the <myform>.designer.cs file to manually delete the controls."

Same here. It works but there must be a better way.

Thanks for the sympathy. Good to know I'm not the only one.