Click here to Skip to main content
15,887,867 members
Articles / Programming Languages / C#

XP theme aware TreeView control which supports checkbox and radio button nodes.

Rate me:
Please Sign up or sign in to vote.
4.70/5 (21 votes)
10 Oct 2003CPOL5 min read 261.1K   3.9K   112  
Internet Explorer advanced settings tree view clone. Supports checkbox and radio button nodes.
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Raccoom.Windows.Forms</name>
    </assembly>
    <members>
        <member name="T:Raccoom.Windows.Forms.TreeViewRadioBox">
            <summary>
            Microsoft Internet Explorer Advanced Settings TreeView Clone. 
            <p>TreeView handles
            <list type="bullet">
            <item><c>checkbox</c> </item>
            <item><c>radiobutton</c> groups</item>
            <item>nodes to group items</item>
            </list>	</p>
            <seealso cref="T:Raccoom.Windows.Forms.TreeNodeCheckBox"/><seealso cref="T:Raccoom.Windows.Forms.TreeNodeRadioButtonGroup"/><seealso cref="T:Raccoom.Windows.Forms.TreeNodeBase"/>
            </summary>
            <example>
             The following example creates a new instance of a TreeViewRadioBox and fill some sample data.
            <code>
            TreeViewRadioBox treeView = new TreeViewRadioBox();
            //
            treeView.BeginUpdate();									
            // create group
            TreeNodeGroup group1= new TreeNodeGroup("Windows Forms");			
            treeView.Nodes.Add(group1);
            // create radiobutton group
            TreeNodeRadioButtonGroup radioGroupNode = new TreeNodeRadioButtonGroup(typeof(System.Windows.Forms.FlatStyle).Name,1,1);			
            group1.Nodes.Add(radioGroupNode);
            // create radiobutton group items
            foreach(string data in Enum.GetNames(typeof(System.Windows.Forms.FlatStyle)))
            {
            	TreeNodeRadioButton subnode = new TreeNodeRadioButton (data.ToString());				
            	subnode.UserData = data;
            	//
            	radioGroupNode.Nodes.Add(subnode);
            }
            // set selected radio button
            radioGroupNode.Nodes[0].Checked = true;
            // add checkbox node
            TreeNodeCheckBox checkBoxNode = new TreeNodeCheckBox("XP Themes enabled");			
            group1.Nodes.Add(checkBoxNode);
            checkBoxNode.Checked = true;
            // add checkbox node
            group1.Nodes.Add(new TreeNodeCheckBox("Manifest"));
            // create group
            TreeNodeGroup group2 = new TreeNodeGroup("System Web",2,2);
            treeView.Nodes.Add(group2);
            // add radio button group node
            radioGroupNode = new TreeNodeRadioButtonGroup(typeof(System.UriHostNameType).Name,3,3);			
            group2.Nodes.Add(radioGroupNode);
            // create radio button items
            foreach(string data in Enum.GetNames(typeof(System.UriHostNameType)))
            {
            	TreeNodeRadioButton subnode = new TreeNodeRadioButton (data.ToString());				
            	subnode.UserData = data;
            	//
            	radioGroupNode.Nodes.Add(subnode);
            }
            // set seleteted radio button
            radioGroupNode.Nodes[0].Checked = true;
            // create checkbox node
            group2.Nodes.Add(new TreeNodeCheckBox("Use IIS 6.0"));		
            // create checkbox nodes
            treeView.Nodes.Add(new TreeNodeCheckBox("C# supported"));
            treeView.Nodes.Add(new TreeNodeCheckBox("C++ managed supported"));
            //
            treeView.EndUpdate();		
            </code>
            </example>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeViewRadioBox.checkboxIndex_">
            <summary>Specifies the <c>Imagelist</c> index where the dynamic loaded image relies.</summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeViewRadioBox.radioIndex_">
            <summary>Specifies the <c>Imagelist</c> index where the dynamic loaded image relies.</summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeViewRadioBox.suspendItemCheckedEvent_">
            <summary>Used to supress <c>ItemChecked</c> event while loading data.</summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.SuspendItemCheckedEvent(System.Boolean)">
            <summary>
            Indicates if OnItemChanged Event is fired.
            While loading data is not valid to fire this event, so we supress it.
            </summary>
            <param name="supressEvent"><c>True</c> to supress the event, <c>False</c> to allow it. </param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.OnItemChecked(System.Windows.Forms.TreeViewEventArgs)">
            <summary>
            Raises the <c>ItemChecked</c> event
            </summary>
            <param name="e"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.OnAfterCheck(System.Windows.Forms.TreeViewEventArgs)">
            <summary>
            Raises the AfterCheck event.
            </summary>
            <param name="e"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.OnClick(System.EventArgs)">
            <summary>
            Raises the Click event.
            </summary>
            <param name="e"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.OnKeyUp(System.Windows.Forms.KeyEventArgs)">
            <summary>
            Raises the KeyUp event.
            </summary>
            <param name="e"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs)">
            <summary>
            Raises the BeforeCollapse event.
            </summary>
            <param name="e"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.AddImages">
            <summary>
            Add the needed images to the <c>Imagelist</c> to draw <c>Checkbox</c> and <c>RadioButton</c>.
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.FireEvent(System.Windows.Forms.TreeNode,System.Windows.Forms.TreeViewAction)">
            <summary>
            Raises the <c>OnItemChecked</c> event if needed
            </summary>
            <param name="currentNode"></param>
            <param name="action"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.TreeViewRadioBox_SystemColorsChanged(System.Object,System.EventArgs)">
            <summary>
            If system colors has changed, the imagelist needs to be updated with the new checkbox and radiobutton images.
            </summary>
            <param name="sender"></param>
            <param name="e"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.AddImagesNonThemed(System.Drawing.Bitmap,System.Drawing.Rectangle)">
            <summary> 
            Add the needed images to the <c>Imagelist</c> to draw <c>Checkbox</c> and <c>RadioButton</c> not theme aware.
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBox.AddImagesThemed(System.Drawing.Bitmap,System.Drawing.Rectangle)">
            <summary> 
            Add the needed images to the <c>Imagelist</c> to draw <c>Checkbox</c> and <c>RadioButton</c> theme aware.
            </summary>
        </member>
        <member name="E:Raccoom.Windows.Forms.TreeViewRadioBox.ItemChecked">
            <summary>Event is raised if <c>checkbox</c> or <c>radio button</c> value has changed.</summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeViewRadioBox.ImageList">
            <summary>
            Gets or sets the ImageList that contains the Image objects used by the tree nodes.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeViewRadioBox.Nodes">
            <summary>
            Gets the collection of tree nodes that are assigned to the tree view control.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeViewRadioBox.InternalNodes">
            <summary>
            Gets the collection of tree nodes that are assigned to the tree view control.
            </summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeNodeBase">
            <summary>
            Base abstract <c>TreeNode</c> used for common features
            </summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeNodeBase.userData_">
            <summary>The object that contains data about the control.</summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeNodeBase.#ctor(System.String)">
            <summary>
            Standard constructor
            </summary>
            <param name="text"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeNodeBase.UpdateCheckState">
            <summary>
            Raised if the <c>TreeNode</c> checked state has changed.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeNodeBase.UserData">
            <summary>
            Gets or sets the object that contains data about the control.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeNodeBase.Nodes">
            <summary>
            Gets the collection of tree nodes that are assigned to the tree view control.
            </summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeNodeCheckBox">
            <summary>
            <c>TreeNode</c> which represents a <c>Checkbox</c>
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeNodeCheckBox.UpdateCheckState">
            <summary>
            Raised if the <c>TreeNode</c> checked state has changed.
            </summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeNodeRadioButton">
            <summary>
            <c>TreeNode</c> which represents a <c>RadioButton</c>
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeNodeRadioButton.UpdateCheckState">
            <summary>
            Raised if the <c>TreeNode</c> checked state has changed.
            </summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeNodeGroup">
            <summary>
            <c>TreeNode</c> which represents a group node.
            </summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeNodeRadioButtonGroup">
            <summary>
            <c>TreeNode</c> which represents a <c>RadioButton</c> parent node.
            </summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeNodeRadioButtonGroup.selectedRadioButton_">
            <summary>
            The current selected radio button value.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeNodeRadioButtonGroup.Nodes">
            <summary>
            Gets the collection of tree nodes that are assigned to the tree view control.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeNodeRadioButtonGroup.SelectedItemValue">
            <summary>
            Gets the selected <c>TreeNodeRadioButton</c> <c>UserData</c> property.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeNodeRadioButtonGroup.SelectedItem">
            <summary>
            Gets or sets the selected <c>TreeNodeRadioButton</c>.
            </summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeNodeBaseCollection">
            <summary>
            Collection for <c>TreeNodeBase</c>
            </summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeNodeBaseCollection.checkboxIndex_">
            <summary>Specifies the <c>Imagelist</c> index where the dynamic loaded image relies.</summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeNodeBaseCollection.radioIndex_">
            <summary>Specifies the <c>Imagelist</c> index where the dynamic loaded image relies.</summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeNodeRadioButtonCollection">
            <summary>
            Collection for <c>TreeNodeRadioButton</c>
            </summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeNodeRadioButtonCollection.checkboxIndex_">
            <summary>Specifies the <c>Imagelist</c> index where the dynamic loaded image relies.</summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeNodeRadioButtonCollection.radioIndex_">
            <summary>Specifies the <c>Imagelist</c> index where the dynamic loaded image relies.</summary>
        </member>
        <member name="T:Raccoom.Windows.Forms.TreeViewRadioBoxReflection">
            <summary>
            Microsoft Internet Explorer Advanced Settings TreeView Clone. 
            <p>TreeView handles
            <list type="bullet">
            <item><c>checkbox</c> </item>
            <item><c>radiobutton</c> groups</item>
            <item>nodes to group items</item>
            </list></p>
            <seealso cref="T:Raccoom.Windows.Forms.TreeNodeCheckBox"/><seealso cref="T:Raccoom.Windows.Forms.TreeNodeRadioButtonGroup"/><seealso cref="T:Raccoom.Windows.Forms.TreeNodeBase"/>
            <p>Provides a user interface for browsing the properties of an object. The public read and writeable properties of type
            <c>bool</c> and <c>enum</c> are fetched and displayed as <c>CheckBoxes</c> and <c>RadioButtons</c>.</p>
            <p>The fetched properties are bound to the nodes, if you change the states in the treeview your instance is updated.</p>
            </summary>
            <example>
            The following example creates a new instance of a TreeViewRadioBoxReflection and set a DataGridBoolColumn as selected object.
            <code>
            TreeViewRadioBox treeViewRadioBox = new TreeViewRadioBox();
            treeViewRadioBox.SelectedObject = new System.Windows.Forms.DataGridBoolColumn();
            </code>
            </example>
            <remarks>The reflection only fill <c>bool</c> and <c>enum</c> types, the selected object must provide this types, otherwise don't be suprised about a empty TreeViewRadioBoxReflection.</remarks>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.clearImageIndex_">
            <summary>Specifies the <c>Imagelist</c> index where the dynamic loaded image relies.</summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.selectedObject_">
            <summary>The object for which the treeview displays properties.</summary>
        </member>
        <member name="F:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.components">
            <summary>
            Required designer variable.
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.#ctor(System.ComponentModel.IContainer)">
            <summary>
            Constructor needed for Design Time
            </summary>
            <param name="container"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.#ctor">
            <summary>
            Standard constructor
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.AddImages">
            <summary>
            Add the needed images to the <c>Imagelist</c> to draw <c>Checkbox</c> and <c>RadioButton</c>.
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.OnItemChecked(System.Windows.Forms.TreeViewEventArgs)">
            <summary>
            Raise the ItemChecked event, handle databinding between properties and nodes.
            </summary>
            <param name="e"></param>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.Dispose(System.Boolean)">
            <summary> 
            Clean up any resources being used.
            </summary>
        </member>
        <member name="M:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.InitializeComponent">
            <summary>
            Required method for Designer support - do not modify
            the contents of this method with the code editor.
            </summary>
        </member>
        <member name="P:Raccoom.Windows.Forms.TreeViewRadioBoxReflection.SelectedObject">
            <summary>
            Gets or sets the object for which the treeview displays properties.
            </summary>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Switzerland Switzerland
My interest is in the future because I am going to spend the rest of my life there. (Charles Kettering)

Biography

  • 1996 - 1998 PC Board PPL, HTML, DHTML, Javascript and ASP
  • 1999 - 2001 coding Centura against Sql Database (SqlBase,MSSQL,Oracle)
  • 2002 - 2004 C# Windows Forms
  • 2005 - 2006 C# ASP.NET, Windows Forms
  • 2006 - 2009 C#, WCF, WF, WPF
  • 2010 - 2012 C#, Dynamics CRM, Sharepoint, Silverlight
  • 2013 - 2013 C#, WCF DS (OData), WF, WPF
  • 2014 - 2016 C#, Azure PaaS, Identity, OWIN, OData, Web Api
  • 2017 - now C#, aspnet.core, IdentityServer4, TypeScript & Angular @ Azure IaaS or PaaS

Interests

  • family & friends
  • chilaxing ,)
  • coding

Comments and Discussions