バージョン

ExpansionIndicatorPadding プロパティ

展開インジケータの左側と右側で使用するパッディングの量を取得または設定します。
シンタックス
'宣言
 
Public Property ExpansionIndicatorPadding As Integer
public int ExpansionIndicatorPadding {get; set;}
解説

展開インジケータの左側と右側のパッディングの量を決定します。指定した値が各側に適用されます。たとえば、3 の値は左側の 3 ピクセルのパッディングと右側の 3 ピクセルのパッディングを示します。

ExpansionIndicatorSize、ExpansionIndicatorPadding、および Indent は密接に関係し、これら 3 つのプロパティの動作は DisplayStyle に依存します。

DisplayStlye が Standard の時、ツリーのノードの実際のインデントは Indent プロパティです。ただし Indent が小さすぎる場合はこの限りではありません。Indent プロパティ値が小さすぎて ExpansionIndicatorSize とそのパッディングを収めることができない場合には収めるために拡大されます。

DisplayStlye が WindowsVista の時、Indent プロパティは無視され、ExpansionIndicatorSize と ExpansionIndicatorPadding を収めるためにインデントは自動的に計算されます。

使用例
Imports Infragistics.Win.UltraWinTree


        ' Define the width and height of the expansion indicators. All of the images need to
        ' be the same size. 
        Const expansionIndicatorImageWidth As Integer = 15
        Const expansionIndicatorImageHeight As Integer = 15

        ' Set the ExpansionIndicatorSize on the tree.
        Me.ultraTree1.ExpansionIndicatorSize = New Size(expansionIndicatorImageWidth, expansionIndicatorImageHeight)

        ' Set the ExpansionIndicatorPadding.
        Me.ultraTree1.ExpansionIndicatorPadding = 3

        ' Tell the tree to hide the expansion indicators whenever the mouse is not over it. 
        Me.ultraTree1.HideExpansionIndicators = HideExpansionIndicators.OnMouseLeave

        ' Create a rect one pixel smaller than the size of the indicators. We will use this to 
        ' draw the ellipses in the indicator images so they don't get clipped. 
        Dim expansionIndicatorImageRect As Rectangle = New Rectangle(0, 0, expansionIndicatorImageWidth - 1, expansionIndicatorImageHeight - 1)

        ' Create a new bitmap for each state of the expansion indicators. 
        Dim expansionIndicatorImageCollapsed As Bitmap = New Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight)
        Dim expansionIndicatorImageExpanded As Bitmap = New Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight)
        Dim expansionIndicatorImageCollapsedHotTracked As Bitmap = New Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight)
        Dim expansionIndicatorImageExpandedHotTracked As Bitmap = New Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight)

        ' Draw the collapsed expansion indicator image.
        ' A red circle. 
        Dim g As Graphics = Nothing
        Try
            g = Graphics.FromImage(expansionIndicatorImageCollapsed)
            g.Clear(Color.Transparent)
            g.FillEllipse(Brushes.Red, expansionIndicatorImageRect)
        Finally
            If Not g Is Nothing Then
                g.Dispose()
            End If
        End Try

        ' Draw the expanded expansion indicator image.
        ' A green circle. 
        Try
            g = Graphics.FromImage(expansionIndicatorImageExpanded)
            g.Clear(Color.Transparent)
            g.FillEllipse(Brushes.Green, expansionIndicatorImageRect)
        Finally
            If Not g Is Nothing Then
                g.Dispose()
            End If
        End Try

        ' Draw the collapsed expansion indicator image.
        ' A red circle with a black border around it.
        Try
            g = Graphics.FromImage(expansionIndicatorImageCollapsedHotTracked)
            g.Clear(Color.Transparent)
            g.FillEllipse(Brushes.Red, expansionIndicatorImageRect)
            g.DrawEllipse(Pens.Black, expansionIndicatorImageRect)
        Finally
            If Not g Is Nothing Then
                g.Dispose()
            End If
        End Try

        ' Draw the collapsed expansion indicator image.
        ' A green circle with a black border around it. 
        Try
            g = Graphics.FromImage(expansionIndicatorImageExpandedHotTracked)
            g.Clear(Color.Transparent)
            g.FillEllipse(Brushes.Green, expansionIndicatorImageRect)
            g.DrawEllipse(Pens.Black, expansionIndicatorImageRect)
        Finally
            If Not g Is Nothing Then
                g.Dispose()
            End If
        End Try

        ' Assign the images to the tree. 
        Me.ultraTree1.ExpansionIndicatorImageCollapsed = expansionIndicatorImageCollapsed
        Me.ultraTree1.ExpansionIndicatorImageExpanded = expansionIndicatorImageExpanded
        Me.ultraTree1.ExpansionIndicatorImageCollapsedHotTracked = expansionIndicatorImageCollapsedHotTracked
        Me.ultraTree1.ExpansionIndicatorImageExpandedHotTracked = expansionIndicatorImageExpandedHotTracked
using Infragistics.Win.UltraWinTree;

            // Define the width and height of the expansion indicators. All of the images need to
            // be the same size. 
            const int expansionIndicatorImageWidth = 15;
            const int expansionIndicatorImageHeight = 15;

            // Set the ExpansionIndicatorSize on the tree.
            this.ultraTree1.ExpansionIndicatorSize = new Size(expansionIndicatorImageWidth, expansionIndicatorImageHeight);

            // Set the ExpansionIndicatorPadding.
            this.ultraTree1.ExpansionIndicatorPadding = 3;

            // Tell the tree to hide the expansion indicators whenever the mouse is not over it. 
            this.ultraTree1.HideExpansionIndicators = HideExpansionIndicators.OnMouseLeave;

            // Create a rect one pixel smaller than the size of the indicators. We will use this to 
            // draw the ellipses in the indicator images so they don't get clipped. 
            Rectangle expansionIndicatorImageRect = new Rectangle(0, 0, expansionIndicatorImageWidth-1, expansionIndicatorImageHeight-1);

            // Create a new bitmap for each state of the expansion indicators. 
            Bitmap expansionIndicatorImageCollapsed = new Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight);
            Bitmap expansionIndicatorImageExpanded = new Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight);
            Bitmap expansionIndicatorImageCollapsedHotTracked = new Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight);
            Bitmap expansionIndicatorImageExpandedHotTracked = new Bitmap(expansionIndicatorImageWidth, expansionIndicatorImageHeight);
            
            // Draw the collapsed expansion indicator image.
            // A red circle. 
            using(Graphics g = Graphics.FromImage(expansionIndicatorImageCollapsed))
            {
                g.Clear(Color.Transparent);
                g.FillEllipse(Brushes.Red, expansionIndicatorImageRect);
            }

            // Draw the expanded expansion indicator image.
            // A green circle. 
            using (Graphics g = Graphics.FromImage(expansionIndicatorImageExpanded))
            {
                g.Clear(Color.Transparent);
                g.FillEllipse(Brushes.Green, expansionIndicatorImageRect);
            }

            // Draw the collapsed expansion indicator image.
            // A red circle with a black border around it. 
            using (Graphics g = Graphics.FromImage(expansionIndicatorImageCollapsedHotTracked))
            {
                g.Clear(Color.Transparent);
                g.FillEllipse(Brushes.Red, expansionIndicatorImageRect);
                g.DrawEllipse(Pens.Black, expansionIndicatorImageRect);
            }

            // Draw the collapsed expansion indicator image.
            // A green circle with a black border around it. 
            using (Graphics g = Graphics.FromImage(expansionIndicatorImageExpandedHotTracked))
            {
                g.Clear(Color.Transparent);
                g.FillEllipse(Brushes.Green, expansionIndicatorImageRect);
                g.DrawEllipse(Pens.Black, expansionIndicatorImageRect);
            }

            // Assign the images to the tree. 
            this.ultraTree1.ExpansionIndicatorImageCollapsed = expansionIndicatorImageCollapsed;
            this.ultraTree1.ExpansionIndicatorImageExpanded = expansionIndicatorImageExpanded;
            this.ultraTree1.ExpansionIndicatorImageCollapsedHotTracked = expansionIndicatorImageCollapsedHotTracked;
            this.ultraTree1.ExpansionIndicatorImageExpandedHotTracked = expansionIndicatorImageExpandedHotTracked;
参照