Using Panels for layout, dynamic object reference

  • Thread starter Thread starter Daren Hawes
  • Start date Start date
D

Daren Hawes

Hi I am new to this and require some advice.

I have an application with say 5 buttons down the side. I have multiple
panels in my application, and on button click I show the relevant panel. IE

panel1.visible = true

I have 2 questions.

1. In designer view I have trouble setting out ach panel as the overlay.
Is there a bettr way to design this out than panels? Can I not show panels
in design view and only view the one I am working on?

Or shall I use user controls and just dynamically show them?

I need to know really how to approach this.

2. I wish to dynamically set the value of a panel object and reference it.
IE Here is a non working example.

for x = 1 to 5
Panel[x].Visible = True
Next x

I would like the for loop variable to reference the correct object. where
[x] shoul be panel1, panel2 etc..

I hope someone can help.

Thx
 
A tabcontrol might be handy here, but I don't have all the specs of your
application ...

I also use panels in an application, I show the relevant panel that
according to the selected node in a treeview...
In design I drag the panels that i'm not using (not designing) to the border
of the form. I place the panel that i'm working on to the middle of the form
so I can access it.
At runtime the panels are positioned dynamically (through code)

I hope this is a relevant question...
 
Back
Top