Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

RadioButtonPartClass Class

An instance of the RadioButtonPartClass class represents a radiobutton part.

Cells can contain one or several radiobuttons (instances of the RadioButtonPartClass). Each radiobutton can operate independently with its own attributes and properties.

A radiobutton can have a checked or unchecked state (RadioButtonStateEnum).

The Action event can be used to handle a radiobutton click.

If the Action event is used, the RadioButtonClicked event and ItemClick event are not raised.

If the Action event is not used or handled by the application, the RadioButtonClicked event is raised. In addition, when the user clicks on the radiobutton, all radiobuttons in the same column in all sibling items of the item containing the radiobutton, are automatically deselected.

Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Inheritance

Syntax

public class RadioButtonPartClass : Softelvdm.Controls.GenericPartClass;
Public Class RadioButtonPartClass
    Inherits Softelvdm.Controls.GenericPartClass

Constructors

PublicRadioButtonPartClassInitializes a new instance of the RadioButtonPartClass class.

Properties

PublicInherited from Softelvdm.Controls.GenericPartClassAngleDefines the rotation of the part.
PublicEnabledDefines whether the radiobutton is enabled.
PublicInherited from Softelvdm.Controls.GenericPartClassHAlignDefines the horizontal alignment within the part's available space.
PublicInherited from Softelvdm.Controls.GenericPartClassOrientationReturns the orientation of parts within a cell. This is defined by the cell or the owner of the cell.
PublicInherited from Softelvdm.Controls.GenericPartClassPartAlignmentDefines the part alignment of this part relative to its container and other parts.
PublicInherited from Softelvdm.Controls.GenericPartClassPartOwnerReturns the owner of the part, usually an object derived from CellBaseClass.
PublicStateDefines the radiobutton state.
PublicInherited from Softelvdm.Controls.GenericPartClassTagObjectDefines application-specific data.
PublicInherited from Softelvdm.Controls.GenericPartClassTagStringDefines an application-specific string.
PublicInherited from Softelvdm.Controls.GenericPartClassVAlignDefines the vertical alignment within the part's available space.
PublicInherited from Softelvdm.Controls.GenericPartClassVisibleAppearanceReturns the visibility status of the part.

Methods

ProtectedInherited from Softelvdm.Controls.GenericPartClassCalcRotatedSizeCalculates the size of the smallest rectangle that can contain the rotated rectangle of a given size, based on the part's GenericPartClass.Angle property.
ProtectedCalcSizeCalculates the size of the part.
ProtectedInherited from Softelvdm.Controls.GenericPartClassCalcUnrotatedBaseWidthCalculates the actual width of the part, based on the width of the rotated part's containing rectangle.
ProtectedInherited from Softelvdm.Controls.GenericPartClassConsiderForOutlineDefines whether the part is considered when calculating the outline rectangle of a cell.
ProtectedCopyCreates an identical copy of the part.
ProtectedStaticInherited from Softelvdm.Controls.GenericPartClassCopyPartCopies information from one part to another.
PublicInherited from System.ObjectEqualsDetermines whether the specified object is equal to the current object.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicInherited from System.ObjectGetHashCodeServes as the default hash function.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
ProtectedInherited from Softelvdm.Controls.GenericPartClassGetVisibleReturns the current visibility status of a part, based on the part's GenericPartClass.VisibleAppearance property.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
ProtectedInherited from Softelvdm.Controls.GenericPartClassOnContentChangedCalled when the contents of the part changed.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
ProtectedStrategyRoutineUsed to perform various actions the part supports, like rendering the part, hit-testing, determining its position and responding to mouse button clicks.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.

Events

PublicInherited from Softelvdm.Controls.GenericPartClassActionOccurs when a part's action is triggered by the user.

Examples

C#

            // Add an item
            ItemClass item = sftTree1.ItemCollection.Add();
            CellClass cell = item.Cells[0];
            item.Image = img;
            cell.Text = "Category 1";
            // Add some sub items
            ItemClass subItem = item.Add();
            RadioButtonPartClass rb = new RadioButtonPartClass(RadioButtonStateEnum.Checked);
            subItem.Cells[0].Parts.Add(rb);
            subItem.Cells[0].Parts.Add(new CheckBoxPartClass());
            subItem.Cells[0].Parts.Add(new TextPartClass("Item 1"));
            subItem = item.Add();
            rb = new RadioButtonPartClass(RadioButtonStateEnum.Unchecked);
            subItem.Cells[0].Parts.Add(rb);
            subItem.Cells[0].Parts.Add(new TextPartClass("Item 2"));
            subItem = item.Add();

VB.NET

    ' Add an item
    Dim item As ItemClass = sftTree1.ItemCollection.Add()
    Dim cell As CellClass = item.Cells(0)
    item.Image = img
    cell.Text = "Category 1"
    ' Add some sub items
    Dim subItem As ItemClass = item.Add()
    Dim rb As RadioButtonPartClass = New RadioButtonPartClass(RadioButtonStateEnum.Checked)
    subItem.Cells(0).Parts.Add(rb)
    subItem.Cells(0).Parts.Add(New CheckBoxPartClass())
    subItem.Cells(0).Parts.Add(New TextPartClass("Item 1"))
    subItem = item.Add()
    rb = New RadioButtonPartClass(RadioButtonStateEnum.Unchecked)
    subItem.Cells(0).Parts.Add(rb)
    subItem.Cells(0).Parts.Add(New TextPartClass("Item 2"))
    subItem = item.Add()

See Also Classes | SftTree/NET 2.0