Where Did My Form Control Disappear To??

RayLivingston

New member
Joined
Dec 22, 2016
Messages
4
Programming Experience
10+
I have a c# app I've worked on off and on for about a year. I started with some code I downloaded from somewhere on the net, and modified from there. The form included a custom graphics control the does some data graphing. Last night I tried to make a minor change to the layout of the form. At one point, I changed the Dock property of the custom control, and the entire control simply disappeared, and I can't for the life of me figure out how to get it back. It appears to still exist in the code, but for the life of me I cannot find it in the Designer to put it back where/how it was. When I run the app, it comes up, but without that control, and other, totally unrelated, things also no longer work.

Any tips on how I can find and repair the missing control? I've spent a couple of hours on it, and gotten nowhere.

Regards,
Ray L.
 
Thank goodness! I got it back! Somehow, the size of the control got set to 0,0. I hand-edited the Designer.cs file and got it back.

Sorry for the fire drill!

Regards,
Ray L.
 
You shouldn't have had to edit the designer file. You can select a control or component using the Document Outline window or the drop-down at the top of the Properties window, even if you can't see it. You can then edit the properties as required in the Properties window.
 
You shouldn't have had to edit the designer file. You can select a control or component using the Document Outline window or the drop-down at the top of the Properties window, even if you can't see it. You can then edit the properties as required in the Properties window.

The only way I can find that control even now is to search for the controls name in the Class View dialog, but that displays only a small handful of very generic properties, none of which have anything to do with the setting(s) that caused the control to disappear. Editing the Designer file was the only way I could find to actually see and change those settings. I think it's something bizarre in the way the control is created, which I really don't understand, since it's code I found on the Internet, and I've had little luck understanding most of it.

Regards,
Ray L.
 
Ah! I see! Yes, you're right, it does show up there. Obviously, I'm not all that familiar with form design using VS. I figured there HAD to be a way to select a control from a list, but on my (laptop) display, the little "down arrow" in that drop-down is almost invisible. I never actually noticed it.

Thanks!

Regards,
Ray L.
 
You should also take a look at the Document Outline window because it can do more than just select a control. It's an excellent way to specify the z-order as well as move controls into and out of specific parents. It's particularly useful if you have overlapping controls, e.g. multiple Panels stacked so that you can only see one at a time.
 
Back
Top Bottom