Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

ButtonPartClass Class

An instance of the ButtonPartClass class represents a button part.

Cells can contain one or several push buttons (instances of the ButtonPartClass). Each button can operate independently with its own attributes and properties.

A push button can contain an image or text (not both).

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

If the Action event is used, the ItemClick event is not raised.

Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Inheritance

Syntax

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

Constructors

PublicButtonPartClassInitializes a new instance of the ButtonPartClass class.

Properties

PublicInherited from Softelvdm.Controls.GenericPartClassAngleDefines the rotation of the part.
PublicAppearanceDefines the button appearance.
PublicEnabledDefines whether the button is enabled.
PublicFontDefines the button's text font.
PublicForeColorDefines the button's text color.
PublicInherited from Softelvdm.Controls.GenericPartClassHAlignDefines the horizontal alignment within the part's available space.
PublicImageDefines the button image.
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.
PublicPressedDefines whether the button is currently pressed.
PublicInherited from Softelvdm.Controls.GenericPartClassTagObjectDefines application-specific data.
PublicInherited from Softelvdm.Controls.GenericPartClassTagStringDefines an application-specific string.
PublicTextDefines the button text.
PublicToggleDefines whether the button is a toggle button.
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 a progressbar to the first cell
            ProgressBarPartClass pbp = new ProgressBarPartClass(0, 50, 25, 100, 12, GadgetAppearanceEnum.ThemedSystem,
                            Color.Red, Color.White, System.Drawing.Drawing2D.LinearGradientMode.Vertical);
            pbp.PartAlignment = PartAlignmentEnum.EntireArea;
            pbp.Appearance = GadgetAppearanceEnum.System;
            item.Cells[0].Parts.Add(pbp);

            // Add a button to the second cell
            ButtonPartClass bp = new ButtonPartClass(false, HAlignmentOptionalEnum.Default, VAlignmentOptionalEnum.Default,
                        true, false, GadgetAppearanceEnum.ThemedSystem, null, "Click Me", null, Color.Red);
            bp.Action += new GenericPartClass.ActionEventHandler(bp_Action);
            item.Cells[1].Parts.Add(bp);

            // Add text to the third cell
            cell = item.Cells[2];
            cell.Text = "Sample Text";

VB.NET

    ' Add a progressbar to the first cell
    Dim pbp As ProgressBarPartClass = New ProgressBarPartClass(0, 50, 25, 100, 12, GadgetAppearanceEnum.ThemedSystem, _
                Color.Red, Color.White, System.Drawing.Drawing2D.LinearGradientMode.Vertical)
    pbp.PartAlignment = PartAlignmentEnum.EntireArea
    pbp.Appearance = GadgetAppearanceEnum.System
    item.Cells(0).Parts.Add(pbp)

    ' Add a button to the second cell
    Dim bp As ButtonPartClass = New ButtonPartClass(False, HAlignmentOptionalEnum.Default, VAlignmentOptionalEnum.Default, _
            True, False, GadgetAppearanceEnum.ThemedSystem, Nothing, "Click Me", Nothing, Color.Red)
    AddHandler bp.Action, AddressOf bp_Action
    item.Cells(1).Parts.Add(bp)

    ' Add text to the third cell
    cell = item.Cells(2)
    cell.Text = "Sample Text"

See Also Classes | SftTree/NET 2.0