First the obvious, is the control definitaly in the panel?
somtimes when you drop it on it can be on the form on top
of but not in the panel.

Then ensure the controls are visible themselves.

My hunch would be that the controls need to redraw when you set the
panel to visible. my guess would be if you call
panelx.invalidate
panelx.update

this forces a sycronous redraw of the entire area of the control
(this may need to be done with all subcontrols of the panel either)

One thing that used to be a problem with some container controls
back in the VB days, is they had problems with more than one child,
we used to put all the controls in a frame and put the frame on the
problematic container, so that is only had one child to deal with...
This isn't likely in .net but worth a try anyway...

Off the top of my head I cant think of anything else...
let us know if these suggestions help.

Steven

On Jan 8, 5:08 am, wildbl67 <[email protected]> wrote:
> I have two panels and two buttons.   When button 1 is pressed I want
> panel one to show and when I press panel2 I want panel two to show.
>   The problem arises when I put controls on each of the panels and the
> controls aren't showing properly within their respective panels.
> Could someone give a small clue on how to make this work??
>
> public sub Button1_Click()
>
>       If panel1.visible = false then
>
>        panel1.visible=True
>        panel2.Visible=False
>    End If
> End

Reply via email to