VS2005 - How do you...

  • Thread starter Thread starter Rob Meade
  • Start date Start date
R

Rob Meade

Lo all,

Just putting together some controls on a form - I'm using panels and 4 radio
buttons. Depending which radio button is clicked, a different panel will
appear - but they all need to appear at the same coordinates. In the
designer I can over lay one of the other - but this makes it more difficult
to then view.

I could of course (presumably) put them else where and then move the
container to the required coordinates - but - surely - there must be a
better way.

If you want to look at an example of what I'm trying to do - fire up your
Windows Task Scheduler - after the first couple of screens you get to the
one with the Daily/Weekly/Monthly/Yearly options - as you choose different
options - the options on the right hand changed - this is what I want to
achieve - but equally - with ease in the designer.

Any info/help appreciated.

Regards

Rob
 
Rob said:
Lo all,

Just putting together some controls on a form - I'm using panels and 4 radio
buttons. Depending which radio button is clicked, a different panel will
appear - but they all need to appear at the same coordinates. In the
designer I can over lay one of the other - but this makes it more difficult
to then view.

I could of course (presumably) put them else where and then move the
container to the required coordinates - but - surely - there must be a
better way.

If you want to look at an example of what I'm trying to do - fire up your
Windows Task Scheduler - after the first couple of screens you get to the
one with the Daily/Weekly/Monthly/Yearly options - as you choose different
options - the options on the right hand changed - this is what I want to
achieve - but equally - with ease in the designer.

Any info/help appreciated.

Regards

Rob

How about putting a tab control on the form and then hiding it at runtime. Then all the radio
buttons need to is bring the correct tab page to the top and you achieve the same goal. Plus
everything makes sense in the designer.
 
Another option is to use just one panel of the right size and position.
Then for each "page" you would create a user control with the
appropriate controls. When one of the radio buttons is selected you
create the appropriate control and place it in the panel.
Additionally, you get the benefits of being able to switch from control
to control in the designer.

Along the same lines, you can also use a captionless form inside the
panel instead of a user control.
 
Rob Meade said:
Lo all,


I could of course (presumably) put them else where and then move the
container to the required coordinates - but - surely - there must be a
better way.

fwiw, this is exactly how a TabStrip (Microsoft Windows Common Controls)
works... and has worked since "who knows when". Basically, throw a few
frames (or "panels" as they seem to be called these days) on a form, fill
them with controls and move them into place at runtime using the
TabStrip's.....

.ClientLeft
.ClientTop
.ClientWidth
.ClientHeight

......properties to make sure the frames are on an area of the tab control
that's not covered by a border or tab (iow, the "usable" portion of the
control)
 
Thanks all - lots of suggestions and info there - appreciated - I'll have to
take a look into all of the suggestions you've provided - I'm more a "webby"
person than a "windows" person -so plenty of learning to be done here :o)

Thanks again

Rob7
 
Back
Top