HeaderPane
Main
Hide
Share Link
Print

SftBoxColumn.WidthPix Property

Defines the width of this column in pixels.

Syntax

Get

C#int WPix = object.WidthPix;
VB.NETWPix = object.WidthPix As Integer
C++long WPix = object->WidthPix;
long WPix = object->GetWidthPix();
CHRESULT object->get_WidthPix(long* WPix);
VBWPix = object.WidthPix As Long

Put

C#int object.WidthPix = WPix;
VB.NETobject.WidthPix = WPix As Integer
C++long object->WidthPix = WPix;
void object->PutWidthPix(long WPix);
CHRESULT object->put_WidthPix(long WPix);
VBobject.WidthPix = WPix As Long

object

A SftBoxColumn object.

WPix

The width of the column described by object. The units used are pixels.

Comments

The WidthPix property defines the width of this column in pixels.

The WidthPix property is used to change the width of the column described by object. The column width must be greater or equal to the column's minimum width. The minimum width can be defined using the Column.MinWidth property.

The last column in a control may be defined as an open-ended column (see Columns.OpenEnded). An open-ended column cannot be resized, because an open-ended column doesn't have a defined width. An open-ended column will always use the space remaining between the previous column and the right edge of the control window.

Due to the variable number of levels and the resulting hierarchical display, the width of the first column is always treated as a minimum width. The text portion of the first column will always be at least of the specified width, no matter what level the item is on. This can result in the first column being much wider than the defined width. To calculate the actual width of column 0, add the value returned by the Columns.OverheadWidth property to the value returned by Column.Width.

When changing column widths, the Items.RecalcHorizontalExtent method may have to be used to recalculate the optimal horizontal scrolling extent.

The Column.CalcOptimalWidth or Column.MakeOptimal methods can be used to calculate or define the optimal width for a column. An optimal width allows all text and graphic components in a column to be displayed in their entirety, without being clipped.

Examples

C++ View entire sample code

            s2.Format("Cell %ld,2", index);
            AddOneItem(s0, s1, s2);
        }
    }
    vBox1->BulkUpdate = VARIANT_FALSE;

    CRect rect;
    m_Box1.GetClientRect(&rect);
    vBox1->Column[0]->WidthPix = rect.Width() / 4;
    vBox1->Column[1]->WidthPix = rect.Width() / 4;
    vBox1->RowHeaders->MakeOptimal(0);
    vBox1->Column[2]->MakeOptimal(0);
    vBox1->Items->RecalcHorizontalExtent(0);

    return TRUE;  // return TRUE  unless you set the focus to a control
}

See Also SftBoxColumn Object | Object Hierarchy


Last Updated 11/04/2026 - (email)
© 2026 Softel vdm, Inc.