two panels

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

How can I lay one panel over the other? I want to switch back and forth
between panels that overlap. If I do this and make one invisible can I still
load controls with data if that particular panel is invisible?

Thanks,

JJ
 
I'm not sure that I understand you but here goes.

If you have two panels, and only one is open at any one time, then something
triggers that event (one to open, one to close).
So, in that Sub (or whatever)

Sub page_load()

Protected withEvents panel1 as panel
'Your controls on your form

'populate values in controls regardless of panels
panel1.visible = true 'show panel 1 first

End Sub

Sub panel1close_click()
' I use image buttons sometimes with a '-' or '+' to open and close panels
panel1.visible = false
panel2.visible = true
'populate values in panel 2 controls in change needed
End Sub

Sub panel1open_click()
panel1.visible = true
panel2.visible = false
'populate values in panel 1 controls in change needed
End Sub

and so forth....

By default , hiding a panel hides its controls. But they are on the panel
(form), either placed there on the form or dynamically created via something
like in the page_load.
 
JJ said:
Hi,

How can I lay one panel over the other? I want to switch back and forth
between panels that overlap.

One way to do it is to use an Html/Table control as the place holder of the
overlapped "Panel" controls.

Example: Follow these steps:

1. Drop a Html/Table control with 1-row and 1-column. Set this only row
horizontal/vertical properties to be left/top.
2. Drop a Web/Panel control inside the Html Table control. The Panel should
be aligned to top and left most automatically
3. Position the cursor to the end of Panel1, do not use <Enter> key.
4. Drop another Web/Panel control right where the cursor is.
5. Set "Horizontal" alignment property of both Panels to Left.
6. Create a Button control that toggles Panel1 and 2 back and forth using
their "Visible" property. While doing this, observe each panel position,
each should occupy the same spot each time it is "visible".
If I do this and make one invisible can I still
load controls with data if that particular panel is invisible?

Yes. The "Visible" property only causes the controls to be hidden from the
Page. You can still access them and set their properties in code-behind.

John Webbs
 
Back
Top