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 current horizontal scrolling extent.
Get
VB.NET | Extent = object.HorizontalExtent As Single |
VB | Extent = object.HorizontalExtent As Single |
C#.NET | float Extent = object.HorizontalExtent; |
VC++ | float Extent = object->HorizontalExtent; float Extent = object->GetHorizontalExtent(); |
C | HRESULT object->get_HorizontalExtent(float* Extent); |
Put
VB.NET | object.HorizontalExtent = Extent As Single |
VB | object.HorizontalExtent = Extent As Single |
C#.NET | float object.HorizontalExtent = Extent; |
VC++ | float object->HorizontalExtent = Extent; void object->PutHorizontalExtent(float Extent); |
C | HRESULT object->put_HorizontalExtent(float Extent); |
object
A SftTreeItems object.
Extent
Defines the current horizontal scrolling extent. If this value is 0 (or less than the width of the tree control), horizontal scrolling is disabled. The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.
The HorizontalExtent property defines the current horizontal scrolling extent.
The HorizontalExtent and Items.HorizontalExtentPix methods are synonyms, but may use different coordinate systems.
A tree control's displayable area can be wider than the tree control's window width. If the displayable area is wider, the tree control can be scrolled horizontally if it has a horizontal scroll bar (see Scrollbars property). The width of the displayable area can be set by the application using the Items.RecalcHorizontalExtent method or the Items.HorizontalExtent property. For performance reasons, the optimal width is not automatically calculated when adding items to a tree control.
The width Extent set using this property must be equal to or greater than the combined column widths plus the width returned by the ColumnsObj.OverheadWidth property.
The HorizontalExtent property defines the horizontal extent of the displayable area (or the left pane of a split tree control).
The Items.HorizontalExtent2 property defines the horizontal extent of the displayable area in the right pane of a split tree control. The Items.HorizontalExtent2 property can only be used with a split tree control.
If the width set is smaller than the actual window width, the control cannot be scrolled horizontally. The horizontal scroll bar will be disabled or hidden, based on the Scrollbars property.
By default, a tree control does not handle horizontal scrolling, even if the Scrollbars property defines scroll bars to be available. To start horizontal scrolling, an application has to use the Items.RecalcHorizontalExtent method or the Items.HorizontalExtent property. They indicate to the tree control that horizontal scrolling support is desired and allows it to determine the horizontal scrolling extent.
The tree control doesn't automatically update the horizontal extent when items are added or deleted or other methods or properties are used, which may invalidate the horizontal extent. The Items.RecalcHorizontalExtent method or Items.HorizontalExtent property have to be used again to recalculate or redefine the extent.
AxSftTree1.BulkUpdate = False End If ' make horizontal extent and width of column 0 wider than previous ' setting, but never smaller AxSftTree1.ColumnsObj.MakeOptimal() AxSftTree1.Items.RecalcHorizontalExtent() If horzExtent > AxSftTree1.Items.HorizontalExtent Then AxSftTree1.Items.HorizontalExtent = horzExtent End If If firstColumnWidth > AxSftTree1.get_Column(0).WidthPix Then AxSftTree1.get_Column(0).WidthPix = firstColumnWidth End If End Sub
Private Sub SftTree1_OLEDragDrop(Data As SftTreeLib75.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim insertAt As Integer Dim str As String Dim lvl As Integer, newItem As Integer Dim horzExtent As Single, col0Width As Single ' get horizontal extent and width of column 0 horzExtent = SftTree1.Items.HorizontalExtent col0Width = SftTree1.Column(0).Width insertAt = SftTree1.Items.DropHighlight If insertAt < 0 Then Exit Sub If Data.GetFormat(vbCFText) Then lvl = SftTree1.Item(insertAt).Level str = Data.GetData(vbCFText)
axSftTree1.BulkUpdate = false; } // make horizontal extent and width of column 0 wider than previous // setting, but never smaller axSftTree1.ColumnsObj.MakeOptimal(); axSftTree1.Items.RecalcHorizontalExtent(); if (horzExtent > axSftTree1.Items.HorizontalExtent) axSftTree1.Items.HorizontalExtent = horzExtent; if (firstColumnWidth > axSftTree1.get_Column(0).WidthPix) axSftTree1.get_Column(0).WidthPix = firstColumnWidth; } private void Picture1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject();
See Also SftTreeItems Object | Object Hierarchy