Building an VS.net-style Options dialog?

  • Thread starter Thread starter Colin Cashman
  • Start date Start date
C

Colin Cashman

What's the best way to build a dialog where a listbox on the left side
of the dialog determines which set of controls to display on the right
side of the dialog (similar to VS.net's Options dialog)?
 
The left side control is actually a Treeview control.

You can build a template form that is used to construct the right side
content of the options dialog. Let's call them pageForms.

You design a bunch of pageForms, instantiate them and for every pageForm,
create a tree node and add it to the tree view, after setting its "Tag"
property to the instance of the pageForm.

This way, you can sign up for the AfterSelect event and change the hosted
form on the right side (be sure to set the pageForm's TopLevel property to
false, and border to None.

Alternately, you can experiment using UserControl for this (the benefit is
the Tab key handling comes for free).

HTH

-vJ
 
Alternately, you can experiment using UserControl for this (the benefit is
the Tab key handling comes for free).

Are there any downsides to building a UserControl for each "pageForm"
instead of building an actual Form?
 
Not that I know of. Since both Form and UserControl derive from the same
base class, you should be able to switch between them (in code) fairly
easily.

Good Luck.

-vJ
 
Not that I know of. Since both Form and UserControl derive from the same
base class, you should be able to switch between them (in code) fairly
easily.

Good Luck.

Thank you very much for your help! :)
 
Back
Top