On Jul 29, 2009, at 6:05 PM, Miguel Lopes wrote:
> I'm wondering about how to add or remove panels from a form at
> runtime.
> I see two approaches:
>
> 1. Creating a new panel and replacing an existing one (destroying
> the old one).
> Meaning the new panel would take whatever sizer slot the original
> panel was occupying.
>
> I haven't thought about how this could be achieved. Any clues?
>
> 2. Creating both panels up-front with one of them hidden (with the
> Visible property set to False) .
> Then it would be a matter of toggling the visibility of panels to hide
> or show them.
>
> I wonder if you have a better approach, or if there is something
> missing in the following approach?
Are these panels supposed to occupy the same area? If so, you should
look into the (rather clumsily-named) dPageFrameNoTabs class. This is
essentially a tabbed panel control, but without the tabs.
If you have, say, 3 panels that you want to alternate between, you
would create them as pages of the dPageFrameNoTabs class, and then
programmatically switch between them by setting the SelectedPageNumber
property. The class handles the hiding/showing for you.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]