Re: Changing parent container

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



On May 9, 9:50 pm, "Young" <young10...@xxxxxxxxxxx> wrote:
Can someone please help? I am trying to move a panel (standard .NET panels)
control to another panel at run time.

I've 2 panels - Panel1 and Panel2. Both's parent are current the form
container.

When I click on a button, I want to make Panel1 the parent of Panel2. I have
change the background color so I can see what is happening. Also, I make
Panel2 smaller than Panel1 to make sure I can see it in Panel1.

Here are the codes in the button click event:

Panel2.Parent = Panel2
Panel2.BringToFront

When I click on the button, I can see Panel2 is no longer visible and
"possible" moved to Panel1. But I cannot see Panel2 within Panel2.

After you move the (now child) panel, do you set its Location to
ensure that it is correctly positioned in its parent panel?
.



Relevant Pages

  • Panels problem
    ... If i drag panel2 over panel 1 so panel2 is partially overlaying on ... panel1, and then move panel1 to the other corner on the form, panel2 ... If Form_load i make visible panel2 and hide panel1, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How would I find out to which control a given control is docked against...
    ... So the parent from panel1 is the form ... and the parent from panel2 is panel1 I asume or maybe also the form ... > panel2, I should be able to find out as a result that it is docked against ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How would I find out to which control a given control is docked against...
    ... So the parent from panel1 is the form ... and the parent from panel2 is panel1 I asume or maybe also the form ... > panel2, I should be able to find out as a result that it is docked against ...
    (microsoft.public.dotnet.general)
  • Re: How would I find out to which control a given control is docked against...
    ... So the parent from panel1 is the form ... and the parent from panel2 is panel1 I asume or maybe also the form ... > panel2, I should be able to find out as a result that it is docked against ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Changing parent container
    ... I am trying to move a panel ... container. ... When I click on a button, I want to make Panel1 the parent of Panel2. ...
    (microsoft.public.dotnet.framework)