SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the width of this column.
Get
VB.NET | WPix = object.WidthPix As Integer |
VB | WPix = object.WidthPix As Long |
C#.NET | int WPix = object.WidthPix; |
VC++ | long WPix = object->WidthPix; long WPix = object->GetWidthPix(); |
C | HRESULT object->get_WidthPix(long* WPix); |
Put
VB.NET | object.WidthPix = WPix As Integer |
VB | object.WidthPix = WPix As Long |
C#.NET | int object.WidthPix = WPix; |
VC++ | long object->WidthPix = WPix; void object->PutWidthPix(long WPix); |
C | HRESULT object->put_WidthPix(long WPix); |
object
A SftTreeColumn object.
WPix
Defines the width of this column in pixels.
The WidthPix property defines the width of this column.
The Column.Width and WidthPix properties are synonyms, but may use different coordinate systems.
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 tree control may be defined as an open-ended column (see ColumnsObj.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 tree 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 ColumnsObj.OverheadWidth property to the value returned by Column(0).WidthPix.
When changing column widths, the Items.RecalcHorizontalExtent method may have to be used to recalculate the optimal horizontal scrolling extent.
The Column.OptimalWidth 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.
End If End Sub Private Sub AxSftTree1_OLEDragDrop(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_OLEDragDropEvent) Handles AxSftTree1.OLEDragDrop ' get horizontal extent and width of column 0 Dim horzExtent As Integer horzExtent = AxSftTree1.Items.HorizontalExtentPix Dim firstColumnWidth As Integer firstColumnWidth = AxSftTree1.get_Column(0).WidthPix Dim insertAt As Integer insertAt = AxSftTree1.Items.DropHighlight If insertAt < 0 Then Exit Sub If e.data.GetFormat(SftOLEClipboardConstants.sftCFText) Then Dim lvl As Integer lvl = AxSftTree1.get_Item(insertAt).Level
DropTargetPic.Image = (Image) o; } } private void axSftTree1_OLEDragDrop(object sender, AxSftTreeLib75._DSftTreeEvents_OLEDragDropEvent e) { // get horizontal extent and width of column 0 int horzExtent = axSftTree1.Items.HorizontalExtentPix; int firstColumnWidth = axSftTree1.get_Column(0).WidthPix; int insertAt = axSftTree1.Items.DropHighlight; if (insertAt < 0) return; if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFText)) { short lvl = axSftTree1.get_Item(insertAt).Level; string str = (string) e.data.GetData(SftOLEClipboardConstants.sftCFText); int newItem = axSftTree1.Items.Insert(insertAt + 1, str);
void CDragDropDlg::OnOLEDragDropSftTree(LPDISPATCH FAR* Data, long FAR* Effect, short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y) { IVDMDataObjectPtr pDataObject = *Data; ASSERT(pDataObject != NULL); // get horizontal extent and width of column 0 long horzExtent = m_vTree->Items->HorizontalExtentPix; long col0Width = m_vTree->Column[0]->WidthPix; long insertAt = m_vTree->Items->DropHighlight; if (insertAt < 0) return; if (pDataObject->GetFormat(sftCFText) != VARIANT_FALSE) { int lvl = m_vTree->Item[insertAt]->Level; _variant_t object = pDataObject->GetData((short)sftCFText); _bstr_t astring = object;
See Also SftTreeColumn Object | Object Hierarchy