Home All Groups Group Topic Archive Search About

VS2005 - How do you...

Author
23 Jan 2006 11:40 PM
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

Author
24 Jan 2006 12:27 AM
Mark Keogh
Rob Meade wrote:
Show quoteHide quote
> 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.
Author
24 Jan 2006 3:01 PM
Chris Dunaway
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.
Author
24 Jan 2006 11:29 PM
Ken Halter
"Rob Meade" <ten.bewdoowsg***@edaem.bbor> wrote in message
news:tPdBf.6777$wl.2119@text.news.blueyonder.co.uk...
> 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)

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Author
25 Jan 2006 9:02 PM
Rob Meade
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