hey ppl. i was wondering how to design an options form, for example the visual studio options form have a treeview docked to left, and when u select an option the content of the right panel changes, i think each treeviewItem useits own panel and when u select the threeveiw the panel changes, but this is very hard at design time, becasue if u have many options u need many panels, and i just want to know how usually the options forms are made becase its hard to set panels position and size when u work with many of them :P
mig16

Options Form
Greg E
jdonald
Boban, thanks for you helpfull reply, just a little note. You don't have to compare the Type names, you can just compare the type object:
if( control.GetType() == typeof( GroupBox ) )
Or even clearer:
if( control is GroupBox )
Keith Chapman
hi,
Is your problem solved
Thank you,
Bhanu.
acido
private void HideAllGroupControls()
{
foreach (Control _control in this.Controls){
if (_control.GetType().ToString() == typeof(GroupBox).ToString()){
_control.SuspendLayout();
_control.Location =
this.groupCommon.Location;_control.Visible =
false;_control.Enabled =
false;_control.ResumeLayout(
false);}
}
}
private void ShowGroupBox(string groupBoxName){
foreach (Control _control in this.Controls){
if (_control.GetType().ToString() == typeof(GroupBox).ToString()){
if (_control.Name == groupBoxName){
this.SuspendLayout();_control.Visible =
true;_control.Enabled =
true; this.ResumeLayout(false);}
}
}
}
private void treeViewSettings_AfterSelect(object sender, TreeViewEventArgs e){
this.SuspendLayout(); this.HideAllGroupControls();if (e.Node.Tag != null && e.Node.Tag.ToString().Length != 0)
{
this.ShowGroupBox(e.Node.Tag.ToString());
}
this.ResumeLayout();
}
I use Tag property of Treeview Item to store groupbox name that is related to that item.
C. Madsen
Now you add een TreeView control to your form and items to it as needed. Now when a user click and item in the TreeView, you just make the related page (UserControl) visable.
This isn't to hard. But there is no out-of-box control or component for this.