Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBox.SortCompare Event

Two items are compared for sorting purposes.

Syntax

VB.NETPrivate Sub object_SortCompare(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.SortCompare
VBPrivate Sub object_SortCompare(ByVal Text1 As String, ByVal Text2 As String, ByVal vData1 As Variant, ByVal vData2 As Variant, ByVal Value1 As Long, ByVal Value2 As Long, RetVal As Integer)
C#.NETvoid object_SortCompare(object sender, EventArgumentType e);
VC++void OnSortCompareobject(_bstr_t Text1, _bstr_t Text2, const _variant_t& vData1, const _variant_t& vData2, long Value1, long Value2, short* RetVal);
CHRESULT OnSortCompareobject(BSTR Text1, BSTR Text2, VARIANT vData1, VARIANT vData2, long Value1, long Value2, short* RetVal);

object

A SftBox object.

Text1

The cell text of the item to be compared to the cell text Text2 of the second item.

Text2

The cell text of the item to be compared to the cell text Text1 of the first item.

vData1

The first item's Item.DataTag Variant data or the first cell's Cell.DataTag Variant data, depending on the Items.Sort method's SortType parameter.

vData2

The second item's Item.DataTag Variant data or the second cell's Cell.DataTag Variant data, depending on the Items.Sort method's SortType parameter.

Value1

The first cell's Cell.Data data.

Value2

The second cell's Cell.Data data.

RetVal

Used to return the collating sequence to the caller. Return a value greater than zero to indicate that the first item is considered greater than the second item, equal to 0 to indicate that the values are equal, a value less than zero to indicate that the first item is considered less than the second item.

Comments

The SortCompare event occurs when two items are compared for sorting purposes.

Depending on the Items.Sort method's SortType parameter, the SortCompare event is called to compare items as they are being sorted. The SortCompare event is called many times during one call to the Items.Sort method.

As two items are compared, the RetVal return value must be set to provide the result of the comparison.

The combo box should not be updated in any way while handling this event.

See Also SftBox Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.