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 currently selected item.
Get
| VB.NET | ItemIndex = object.Selection As Integer |
| VB | ItemIndex = object.Selection As Long |
| C#.NET | int ItemIndex = object.Selection; |
| VC++ | long ItemIndex = object->Selection; long ItemIndex = object->GetSelection(); |
| C | HRESULT object->get_Selection(long* ItemIndex); |
Put
| VB.NET | object.Selection = ItemIndex As Integer |
| VB | object.Selection = ItemIndex As Long |
| C#.NET | int object.Selection = ItemIndex; |
| VC++ | long object->Selection = ItemIndex; void object->PutSelection(long ItemIndex); |
| C | HRESULT object->put_Selection(long ItemIndex); |
object
ItemIndex
The zero-based index of the selected item. If no item is selected this value is -1.
The Selection property defines the currently selected item.
The SelectionChange event notifies an application when the selection is changed.
Application.Exit()
End Sub
Private Sub CopyImageFromCurrentItem()
Dim ItemIndex As Integer
Dim Img As SftPictureObject
ItemIndex = AxSftBox1.Items.Selection
If ItemIndex < 0 Then Exit Sub
' don't use images that are too large in the other areas
Img = AxSftBox1.get_Cell(ItemIndex, 0).Image
If Img.ActualHeight <= 20 And Img.ActualWidth <= 20 Then
AxSftBox1.RowColumnHeader.Image = Img
AxSftBox1.get_Header(1).Image = Img
Option Explicit
Dim SortDirection As Boolean
Private Sub CopyImageFromCurrentItem()
Dim ItemIndex As Integer
Dim Img As SftPictureObject
ItemIndex = SftBox1.Items.Selection
If ItemIndex < 0 Then Exit Sub
' don't use images that are too large in the other areas
Set Img = SftBox1.Cell(ItemIndex, 0).Image
If Img.ActualHeight <= 20 And Img.ActualWidth <= 20 Then
SftBox1.RowColumnHeader.Image = Img
SftBox1.Header(1).Image = Img
Application.Exit();
}
private void CopyImageFromCurrentItem()
{
int ItemIndex;
SftPictureObject Img;
ItemIndex = axSftBox1.Items.Selection;
if (ItemIndex < 0)
return;
// don't use images that are too large in the other areas
Img = axSftBox1.get_Cell(ItemIndex, 0).Image;
if (Img.ActualHeight <= 20 && Img.ActualWidth <= 20) {
axSftBox1.RowColumnHeader.Image = Img;
AddBuiltinImage(_T("Enabled Descending Indicator"), sftImageSortDesc, 8, 8);
AddBuiltinImage(_T("Disabled Descending Indicator"), sftImageSortDescDisabled, 8, 8);
m_vBox->RowHeaders->MakeOptimal(0); // make the row headers optimal
m_vBox->Column[0]->MakeOptimal(0); // make the first column optimal
m_vBox->Items->RecalcHorizontalExtent(0); // update horizontal scroll bar
m_vBox->Items->Selection = 0;
CopyImageFromCurrentItem();
return TRUE; // return TRUE unless you set the focus to a control
}
void CPicturesDlg::PropagateImage(long ItemIndex, ISftPictureObjectPtr Img)See Also SftBoxItems Object | Object Hierarchy
