Buggy-Looking Behavior



I hate to jump to the conclusion that there is a bug going on here, so maybe someone can help me.

I have added a new Class Library project to my solution, and to that I have added a new User Control. I have placed a couple of things on its design surface, and then, after adding references to this project into my main one, dragged an instance of that control onto my main form in the form designer.

When I do that, one of several completely out-of-control things happens:
1) Sometimes, it won't give me an instance at all. Instead, I get a message that says "Object reference is not set to an instance of an object."
2) Sometimes, it drags on ok, but the next time the form window refreshes, all controls on the form have disappeared except for the custom one. Upon inspecting the Windows Form Designer generated code, this is sometimes because all the other controls have disappeared from the call to Me.Controls.AddRange --- but sometimes they are still there; they just don't show up until I remove the custom control from Me.Controls.AddRange.
3) Sometimes the entire form breaks and I get a white screen that says the document cannot be designed or some other gobbledygook. Then I have to manually remove the custom control from the guts of the Form Designer code for it to work again.

This seems to happen to every custom control I design, and I can't figure out why. It's rather hard on the ol' productivity.

.



Relevant Pages

  • Re: Custom control with use resource file
    ... bit clumsy, but you can register a window class for the dialog, then specify that class ... Note that you should also set the "Control Parent" property of the child dialog so the tab ... How can I create custom control ...
    (microsoft.public.vc.mfc)
  • Re: Custom control with use resource file
    ... bit clumsy, but you can register a window class for the dialog, then specify that class ... Note that you should also set the "Control Parent" property of the child dialog so the tab ... How can I create custom control ...
    (microsoft.public.vc.mfc)
  • RE: One small way Visual Studio could prevent me from doing something
    ... control library was not public, the form designer could not serialize the ... InitializeComponent method of the form when you dragged the custom control ... When you opened the form again in the designer, the form designer executed ... Microsoft Online Community Support ...
    (microsoft.public.vsnet.ide)
  • Re: Custom control with use resource file
    ... bit clumsy, but you can register a window class for the dialog, then specify that class ... Note that you should also set the "Control Parent" property of the child dialog so the tab ... How can I create custom control ...
    (microsoft.public.vc.mfc)
  • Re: Inclusion of user control within custom control
    ... | Subject: Re: Inclusion of user control within custom control ... | could load the user control in MyPane and encapsulate header and footer ... | MyPane custom control that you would have described that as a solution. ... the initialization of the usercontrol is a bit different. ...
    (microsoft.public.dotnet.framework.aspnet)