Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

PartEventArgs Class

Provides data for the CheckBoxClicked event and RadioButtonClicked event.

Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Inheritance

Syntax

public class PartEventArgs : System.EventArgs;
Public Class PartEventArgs
    Inherits System.EventArgs

Constructors

PublicPartEventArgsProvides data for the CheckBoxClicked event and RadioButtonClicked event.

Fields

PublicCellDefines which cell owns the part or null/Nothing if no cell is associated with the part.
PublicStaticInherited from System.EventArgsEmptyProvides a value to use with events that do not have event data.
PublicItemDefines which item owns the part.
PublicPartThe part for which the CheckBoxClicked event or RadioButtonClicked event occurred.
PublicRowHeaderDefines which row header owns the part or null/Nothing if no row header is associated with the part.

Methods

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 System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.

Examples

C#

                    GenericPartClass gp = item.Cells[0].Parts[0];
                    if (gp is CheckBoxPartClass) {
                        CheckBoxPartClass cb = (CheckBoxPartClass) gp;
                        cb.State = cb.State == CheckBoxStateEnum.Checked ? CheckBoxStateEnum.Unchecked : CheckBoxStateEnum.Checked;
                        e.Handled = true;
                        // changing the checkbox state doesn't automatically call the CheckBoxClicked event
                        CellClass owningCell = (CellClass)cb.PartOwner;
                        ItemClass owningItem = owningCell.OwningItem;
                        sftTree1_CheckBoxClicked(this, new PartEventArgs(owningItem, owningCell, null, cb));
                    } else if (gp is RadioButtonPartClass) {
                        RadioButtonPartClass rb = (RadioButtonPartClass)gp;
                        if (sftTree1.PerformClick_RadioButtonPart(rb)) {
                            e.Handled = true;
                            // changing the radiobutton state doesn't automatically call the RadioButtonClicked event
                            CellClass owningCell = (CellClass) rb.PartOwner;
                            ItemClass owningItem = owningCell.OwningItem;

VB.NET

                    cb.State = CheckBoxStateEnum.Unchecked
                Else
                    cb.State = CheckBoxStateEnum.Checked
                End If
                e.Handled = True
                ' changing the checkbox state doesn't automatically call the CheckBoxClicked event
                Dim owningCell As CellClass = cb.PartOwner
                Dim owningItem As ItemClass = owningCell.OwningItem
                SftTree1_CheckBoxClicked(Me, New PartEventArgs(owningItem, owningCell, Nothing, cb))
            ElseIf TypeOf gp Is RadioButtonPartClass Then
                Dim rb As RadioButtonPartClass = gp
                If SftTree1.PerformClick_RadioButtonPart(rb) Then
                    e.Handled = True
                    ' changing the radiobutton state doesn't automatically call the RadioButtonClicked event
                    Dim owningCell As CellClass = rb.PartOwner
                    Dim owningItem As ItemClass = owningCell.OwningItem

See Also Classes | SftTree/NET 2.0



Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.