src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/VirtualTreeControl.cs
/// <summary>
///     Get the left and width for the expanded column. This is called
///     after ColumnHitTest determines the column, and GetBlankExpansion
///     determines the column range.
/// </summary>
/// <param name="leftColumn">The leftmost column</param>
/// <param name="rightColumn">The rightmost column</param>
/// <param name="itemLeft">The left edge of this column</param>
/// <param name="itemWidth">The width of this column</param>
Get the left and width for the expanded column. This is called
after ColumnHitTest determines the column, and GetBlankExpansion
determines the column range.
Get the left and width for the expanded column . This is called after ColumnHitTest determines the column and GetBlankExpansion determines the column range .
private void GetColumnBounds(int leftColumn, int rightColumn, out int itemLeft, out int itemWidth)
        {
            var columns = (myColumnPermutation != null) ? myColumnPermutation.VisibleColumnCount : myMctree.ColumnCount;
            var adjustLeft = false;
            var adjustRight = false;
            if (!HasVerticalScrollBar)
            {
                if (LeftScrollBar)
                {
                    adjustLeft = true;
                }
                else if (rightColumn == (columns - 1))
                {
                    adjustRight = true;
                }
            }
            var fullPercentWidth = FullPercentageHeaderWidth;
            itemLeft = 0;
            itemWidth = 0;
            int columnWidth;
            if (!myHeaderBounds.HasHeaders)
            {
                columnWidth = fullPercentWidth / columns;
                if (leftColumn > 0)
                {
                    itemLeft = columnWidth * leftColumn;
                }
                if (leftColumn == rightColumn)
                {
                    itemWidth = columnWidth;
                }
                else if (rightColumn == (columns - 1))
                {
                    itemWidth = fullPercentWidth - itemLeft;
                }
                else
                {
                    itemWidth = (rightColumn - leftColumn + 1) * columnWidth;
                }
            }
            else
            {
                myHeaderBounds.GetColumnBounds(fullPercentWidth, leftColumn, rightColumn, out itemLeft, out itemWidth);
            }
            if (adjustRight)
            {
                itemWidth += SystemInformation.VerticalScrollBarWidth;
            }
            else if (adjustLeft)
            {
                if (leftColumn == 0)
                {
                    itemWidth += SystemInformation.VerticalScrollBarWidth;
                }
                else
                {
                    itemLeft += SystemInformation.VerticalScrollBarWidth;
                }
            }
        }
private void GetColumnBounds ( int leftColumn , int rightColumn , out int itemLeft , out int itemWidth ) { var columns = ( myColumnPermutation != null ) ? myColumnPermutation . VisibleColumnCount : myMctree . ColumnCount ; var adjustLeft = false ; var adjustRight = false ; if ( ! HasVerticalScrollBar ) { if ( LeftScrollBar ) { adjustLeft = true ; } else if ( rightColumn == ( columns - 1 ) ) { adjustRight = true ; } } var fullPercentWidth = FullPercentageHeaderWidth ; itemLeft = 0 ; itemWidth = 0 ; int columnWidth ; if ( ! myHeaderBounds . HasHeaders ) { columnWidth = fullPercentWidth / columns ; if ( leftColumn > 0 ) { itemLeft = columnWidth * leftColumn ; } if ( leftColumn == rightColumn ) { itemWidth = columnWidth ; } else if ( rightColumn == ( columns - 1 ) ) { itemWidth = fullPercentWidth - itemLeft ; } else { itemWidth = ( rightColumn - leftColumn + 1 ) * columnWidth ; } } else { myHeaderBounds . GetColumnBounds ( fullPercentWidth , leftColumn , rightColumn , out itemLeft , out itemWidth ) ; } if ( adjustRight ) { itemWidth += SystemInformation . VerticalScrollBarWidth ; } else if ( adjustLeft ) { if ( leftColumn == 0 ) { itemWidth += SystemInformation . VerticalScrollBarWidth ; } else { itemLeft += SystemInformation . VerticalScrollBarWidth ; } } }
Get the left and width for the expanded column.
Get the left and width for the expanded column .
leftColumn
int
The leftmost column
The leftmost column
rightColumn
int
The rightmost column
The rightmost column
int
out
itemLeft
The left edge of this column
The left edge of this column
itemWidth
The width of this column
The width of this column