Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

PartAlignment Property, GenericPartClass Class

Defines the part alignment of this part relative to its container and other parts.

Class: GenericPartClass
Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Syntax

public PartAlignmentEnum PartAlignment { get; set; }
Public Property PartAlignment As PartAlignmentEnum

Value

The part alignment.

The default value is PartAlignmentEnum.Near.

Comments

Defines the part alignment of this part relative to its container and other parts.

The order of the parts within the cell's parts collection determines the display order in the cell, but only for groups of parts that have the same GenericPartClass.PartAlignment property.

Parts are allocated space within the cell in the following order:

  • EntireArea - One part takes up the entire space.
  • FlushStart - The parts are lined up starting at the left/top exterior edge of the cell.
  • FlushEnd - The parts are lined up starting at the right/bottom exterior edge of the cell.
  • StartingEdge - The parts are lined up starting at the left/top edge of the cell's interior space.
  • EndingEdge - The parts are lined up starting at the right/bottom edge of the cell's interior space.
  • Near - The parts are lined up starting at the left/top edge of the remaining interior space, with a suitable gap.
  • Far - The parts are lined up starting at the right/top edge of the remaining interior space, with a suitable gap.
  • Center - The parts are centered within the remaining interior space.

Examples

C#

            ip.Action += new GenericPartClass.ActionEventHandler(ip_Action);

            // Add another item
            item = sftTree1.ItemCollection.Add();

            // 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);

VB.NET

    AddHandler ip.Action, AddressOf ip_Action

    ' Add another item
    item = sftTree1.ItemCollection.Add()

    ' 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

See Also GenericPartClass Class | Classes | SftTree/NET 2.0