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
Sorts items.
VB.NET | object.Sort(ByVal ItemIndex As Integer, ByVal ColNum As Short, ByVal SortType As SftBoxSortConstants) |
VB | object.Sort(ByVal ItemIndex As Long, ByVal ColNum As Integer, ByVal SortType As SftBoxSortConstants) |
C#.NET | void object.Sort(int ItemIndex, short ColNum, SftBoxSortConstants SortType); |
VC++ | HRESULT object->Sort(long ItemIndex, short ColNum, enum SftBoxSortConstants SortType); |
C | HRESULT object->raw_Sort(long ItemIndex, short ColNum, enum SftBoxSortConstants SortType); |
object
ItemIndex
The zero-based index of the item whose dependents are to be sorted. Specify -1 to sort all items.
ColNum
The zero-based index of the column whose contents are to be used for sorting purposes.
SortType
Defines the sorting method used.
Name | Value | Description |
---|---|---|
sortSftBoxAscending | 0 | Items defined by ItemIndex are sorted using the Cell.Text property in column ColNum, in ascending fashion. The SortCompare event is not used. |
sortSftBoxDescending | 1 | Items defined by ItemIndex are sorted using the Cell.Text property in column ColNum, in descending fashion. The SortCompare event is not used. |
sortSftBoxCellValueAscending | 2 | Items defined by ItemIndex are sorted using the Cell.Data property in column ColNum, in ascending fashion. The SortCompare event is not used. |
sortSftBoxCellValueDescending | 3 | Items defined by ItemIndex are sorted using the Cell.Data property in column ColNum, in descending fashion. The SortCompare event is not used. |
sortSftBoxItemTagStringAscending | 4 | Items defined by ItemIndex are sorted using the Item.DataTag property, in ascending fashion. The Item.DataTag property is interpreted as a string. The SortCompare event is not used. The ColNum parameter is not used, but must be a valid column. |
sortSftBoxItemTagStringDescending | 5 | Items defined by ItemIndex are sorted using the Item.DataTag property, in descending fashion. The Item.DataTag property is interpreted as a string. The SortCompare event is not used. The ColNum parameter is not used, but must be a valid column. |
sortSftBoxItemTagLongAscending | 6 | Items defined by ItemIndex are sorted using the Item.DataTag property, in ascending fashion. The Item.DataTag property is interpreted as a Long value. The SortCompare event is not used. The ColNum parameter is not used, but must be a valid column. |
sortSftBoxItemTagLongDescending | 7 | Items defined by ItemIndex are sorted using the Item.DataTag property, in descending fashion. The Item.DataTag property is interpreted as a Long value. The SortCompare event is not used. The ColNum parameter is not used, but must be a valid column. |
sortSftBoxItemTag | 8 | Items defined by ItemIndex are sorted using the SortCompare event. The SortCompare event receives the Cell(ColNum).Text, Item.DataTag and Cell(ColNum).Data properties for each item as arguments. |
sortSftBoxCellTag | 9 | Items defined by ItemIndex are sorted using the SortCompare event. The SortCompare event receives the Cell(ColNum).Text, Cell(ColNum).DataTag and Cell(ColNum).Data properties for each item as arguments. |
sortSftBoxCellText | 10 | Items defined by ItemIndex are sorted using the SortCompare event. The SortCompare event receives the Cell(ColNum).Text properties for each item as arguments. The parameters vData and Value of the SortCompare event are not used. |
The Sort method sorts items.
Based on the specified column number ColNum, the immediate dependents of the specified item ItemIndex are sorted according to the SortType specified. To sort all items specify ItemIndex as -1.
When sorting dependents, only immediate dependents are sorted, i.e., items on the immediate lower level. Dependents of items being sorted are moved with their parent item, but are not sorted. Invoke the Sort method separately for each parent item to be sorted.
AxSftBox1.get_Header(0).Image.Appearance = SftPictureImageConstants.sftImageSortDesc
End If
m_SortDirection = Ascending
End Sub
Private Sub SetSortDirection(ByVal NewDirection As Boolean)
ShowSortDirection(NewDirection)
If NewDirection Then
AxSftBox1.Items.Sort(-1, 0, SftBoxSortConstants.sortSftBoxAscending)
Else
AxSftBox1.Items.Sort(-1, 0, SftBoxSortConstants.sortSftBoxDescending)
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SftBox1.Header(0).Image.Appearance = sftImageSortDesc
End If
SortDirection = Ascending
End Sub
Private Sub SetSortDirection(ByVal NewDirection As Boolean)
ShowSortDirection NewDirection
If NewDirection Then
SftBox1.Items.Sort -1, 0, sortSftBoxAscending
Else
SftBox1.Items.Sort -1, 0, sortSftBoxDescending
End If
End Sub
Private Sub Command1_Click()
axSftBox1.get_Header(0).Image.Appearance = SftPictureImageConstants.sftImageSortDesc;
m_SortDirection = Ascending;
}
private void SetSortDirection(bool NewDirection)
{
ShowSortDirection(NewDirection);
if (NewDirection)
axSftBox1.Items.Sort(-1, 0, SftBoxSortConstants.sortSftBoxAscending);
else
axSftBox1.Items.Sort(-1, 0, SftBoxSortConstants.sortSftBoxDescending);
}
private void Form1_Load(object sender, System.EventArgs e) {
int ItemIndex = axSftBox1.Items.Add("Supported Picture Types");
m_vBox->Header[0]->Image->Appearance = sftImageSortDesc;
m_fSortDirection = fAscending;
}
void CPicturesDlg::SetSortDirection(BOOL fNewDirection)
{
ShowSortDirection(fNewDirection);
if (fNewDirection)
m_vBox->Items->Sort(-1, 0, sortSftBoxAscending);
else
m_vBox->Items->Sort(-1, 0, sortSftBoxDescending);
}
void CPicturesDlg::ToggleImage(ISftPictureObjectPtr pImg)
{
SftPictureImageConstants Appearance = pImg->Appearance;
See Also SftBoxItems Object | Object Hierarchy