Z-order on my custom control at design-time is wrong

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I've created a very simple custom "UserControl" that has a Panel docked to
the top. I've decorated my custom control with the:
[Designer(typeof(System.Windows.Forms.Design.ScrollableControlDesigner))]
attribute so that I can drop other controls onto it when used elsewhere.

So, I go ahead and drop my custom usercontrol onto a Form, and then drop two
buttons onto the usercontrol. So far, so good. Now, I want to set the Dock
properties of the buttons to Right and Fill. Yes, I know that's silly, but
follow me.

At this point, notice that the Z-ordering is incorrect, such that the top
panel is now covering the button that was set to Fill. Also notice that the
right button ignores the precedence of the Top panel. I can fix it by
right-clicking on the two buttons and changing their Z-order (right-first,
bring to front, fill-second, bring to front). BUT... when I close the form
and re-open it. The Z-order has reverted back to it's original state of
being messed up.

Any ideas on how I can fix this?
--
Lee


.



Relevant Pages

  • Re: Small Doubt
    ... you use an UserControl when its output will be mainly ... static and you use a custom control when its output will be mainly dynamic. ... If you're interested in learning about custom controls you should definitely ... > What is the difference b/w a usercontrol and a Custom Web Control? ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Proper LostFocus behavior
    ... I am in the process of developing a custom control that mimics the Office ... I have a UserControl with a few contained controls, ... control I'm drawing entirely by hand, and a Panel in which I'm doing all my ...
    (microsoft.public.dotnet.framework.drawing)
  • Proper LostFocus behavior
    ... I am in the process of developing a custom control that mimics the Office ... I have a UserControl with a few contained controls, ... control I'm drawing entirely by hand, and a Panel in which I'm doing all my ...
    (microsoft.public.dotnet.general)
  • RE: Binding custom list of usercontrols?
    ... collection and want the Panel to create a UserControl for each business ... You set up data binding between the UserControl ... and the corresponding business object. ... private void RearrangeTextBoxes() ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Cant select Item in a list box
    ... I'll implement your suggestions with the panel. ... >> is cause I'll be using the same class for other usercontrol ... > Personally I like this way of control creation because it allows for a ... > demand then at the users request you can just remove all the children from ...
    (microsoft.public.dotnet.framework.windowsforms.controls)