Results 1 to 7 of 7

Thread: Where Did My Form Control Disappear To??

  1. #1
    RayLivingston is offline C# Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Where Did My Form Control Disappear To??

    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.

  2. #2
    RayLivingston is offline C# Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0
    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.

  3. #3
    jmcilhinney is online now C# Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2011
    Posts
    1,468
    Rep Power
    118
    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.

  4. #4
    RayLivingston is offline C# Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0
    Quote Originally Posted by jmcilhinney View Post
    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.

  5. #5
    jmcilhinney is online now C# Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2011
    Posts
    1,468
    Rep Power
    118
    Are you saying that it's not listed in the Document Outline window or in the drop-down at the top of the Properties window?

  6. #6
    RayLivingston is offline C# Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0
    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.

  7. #7
    jmcilhinney is online now C# Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2011
    Posts
    1,468
    Rep Power
    118
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •