Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBoxDropDown.Suppress Method

Suppresses showing/hiding the drop down portion for the current event.

Syntax

VB.NETobject.Suppress()
VBobject.Suppress
C#.NETvoid object.Suppress();
VC++HRESULT object->Suppress();
CHRESULT object->raw_Suppress();

object

A SftBoxDropDown object.

Comments

The Suppress method suppresses showing/hiding the drop down portion for the current event.

Once an ItemClick or ItemDblClk event is processed, the drop down portion may automatically become visible or may be hidden in response. This default action is built into the control. It is possible to suppress the default response by using the DropDown.Suppress method while handling the ItemClick or ItemDblClk event.

This method has no effect on a simple combo box.

Examples

VB.NET

Private Sub AxSftBox1_ItemClick(ByVal sender As Object, ByVal e As AxSftBoxLib50._ISftBoxEvents_ItemClickEvent) Handles AxSftBox1.ItemClick
    Select Case e.areaType
    Case SftBoxAreaConstants.areaSftBoxColumn
        If e.colNum = 0 Then
            SetSortDirection(Not m_SortDirection)
        End If
    Case SftBoxAreaConstants.areaSftBoxCellGraphic
        If e.part = SftBoxPortionConstants.partSftBoxDropDown Then
            AxSftBox1.DropDown.Suppress() ' Make sure we don't close the drop down
        End If
        ToggleImage(AxSftBox1.get_Cell(e.itemIndex, e.colNum).Image)
    Case SftBoxAreaConstants.areaSftBoxItem
        If e.part = SftBoxPortionConstants.partSftBoxDropDown Then
            AxSftBox1.DropDown.Suppress() ' Make sure we don't close the drop down
        End If
        ToggleImage(AxSftBox1.get_Item(e.itemIndex).Image)

VB6

Private Sub SftBox1_ItemClick(ByVal Part As SftBoxLib50.SftBoxPortionConstants, ByVal AreaType As SftBoxLib50.SftBoxAreaConstants, ByVal ItemIndex As Long, ByVal ColNum As Integer, ByVal Button As Integer, ByVal Shift As Integer)
    Select Case AreaType
    Case areaSftBoxColumn
        If ColNum = 0 Then
            SetSortDirection Not SortDirection
        End If
    Case areaSftBoxCellGraphic
        If Part = partSftBoxDropDown Then SftBox1.DropDown.Suppress ' Make sure we don't close the drop down
        ToggleImage SftBox1.Cell(ItemIndex, ColNum).Image
    Case areaSftBoxItem
        If Part = partSftBoxDropDown Then SftBox1.DropDown.Suppress ' Make sure we don't close the drop down
        ToggleImage SftBox1.Item(ItemIndex).Image
    Case areaSftBoxLabel
        If Part = partSftBoxDropDown Then SftBox1.DropDown.Suppress ' Make sure we don't close the drop down
        ToggleImage SftBox1.Item(ItemIndex).LabelImage
    Case areaSftBoxButton

C#

{
    switch (e.areaType) {
    case SftBoxAreaConstants.areaSftBoxColumn:
        if (e.colNum == 0)
            SetSortDirection(!m_SortDirection);
        break;
    case SftBoxAreaConstants.areaSftBoxCellGraphic:
        if (e.part == SftBoxPortionConstants.partSftBoxDropDown)
            axSftBox1.DropDown.Suppress(); // Make sure we don't close the drop down
        ToggleImage(axSftBox1.get_Cell(e.itemIndex, e.colNum).Image);
        break;
    case SftBoxAreaConstants.areaSftBoxItem:
        if (e.part == SftBoxPortionConstants.partSftBoxDropDown)
            axSftBox1.DropDown.Suppress(); // Make sure we don't close the drop down
        ToggleImage(axSftBox1.get_Item(e.itemIndex).Image);
        break;

C++

{
    switch (AreaType) {
    case areaSftBoxColumn:
        if (ColNum == 0)
            SetSortDirection(!m_fSortDirection);
        break;
    case areaSftBoxCellGraphic:
        if (Part == partSftBoxDropDown)
            m_vBox->DropDown->Suppress(); // Make sure we don't close the drop down
        ToggleImage(m_vBox->Cell[ItemIndex][ColNum]->Image);
        break;
    case areaSftBoxItem:
        if (Part == partSftBoxDropDown)
            m_vBox->DropDown->Suppress(); // Make sure we don't close the drop down
        ToggleImage(m_vBox->Item[ItemIndex]->Image);
        break;

See Also SftBoxDropDown Object | Object Hierarchy


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