Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBoxDropDown.RollUp Method

Hides the drop down portion.

Syntax

VB.NETobject.RollUp(ByVal Delay As Integer)
VBobject.RollUp(ByVal Delay As Long)
C#.NETvoid object.RollUp(int Delay);
VC++HRESULT object->RollUp(long Delay);
CHRESULT object->raw_RollUp(long Delay);

object

A SftBoxDropDown object.

Delay

The number of milliseconds to elapse before the drop down portion is hidden. Specify 0 to hide the drop down portion immediately.

Comments

The RollUp method hides the drop down portion.

The RollUp method can be used to hide the drop down portion after a certain time period has elapsed. The Delay argument defines the length of the time period. If the drop down portion becomes hidden (or visible) during this time as the result of user interaction or other methods and properties, the RollUp method is cancelled and the drop down portion remains unaltered after the time period passes. This is useful during drag & drop processing. Instead of hiding the drop down portion immediately when the OLEDragOver event indicates that the mouse cursor has left the combo box control, the drop down portion can be hidden after a certain time period elapses. If the user moves the cursor back into the combo box, this eliminates the drop down portion from being hidden and shown repeatedly.

The DropDown.Dropped property can also be used to hide the drop down portion.

This method cannot be used with a simple combo box.

Examples

VB.NET

Private Sub comboTarget_OLEDragOver(ByVal sender As Object, ByVal e As AxSftBoxLib50._ISftBoxEvents_OLEDragOverEvent) Handles comboTarget.OLEDragOver
    If e.state = SftBoxOLEDragOverConstants.enterSftBox Then
        ' Show the drop down portion
        comboTarget.DropDown.Dropped = True
    ElseIf e.state = SftBoxOLEDragOverConstants.leaveSftBox Then
        ' Hide the drop down portion with a delay, in case the
        ' user is moving from/to the static or drop down portion
        comboTarget.DropDown.RollUp(500)  ' 1/2 second
    End If
End Sub

Private Sub comboTarget_OLEDragDrop(ByVal sender As Object, ByVal e As AxSftBoxLib50._ISftBoxEvents_OLEDragDropEvent) Handles comboTarget.OLEDragDrop
    If e.data.GetFormat(SftOLEClipboardConstants.sftCFText) Then
        Dim itemIndex As Integer
        itemIndex = comboTarget.Items.Insert(e.data.GetData(SftOLEClipboardConstants.sftCFText), comboTarget.Items.DropIndex)
        comboTarget.Items.Selection = itemIndex

VB6

Private Sub ComboTarget_OLEDragOver(Data As SftBoxLib50.DataObject, TargetIndex As Long, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As SftBoxLib50.SftBoxOLEDragOverConstants)
    If State = enterSftBox Then
        ' Show the drop down portion
        ComboTarget.DropDown.Dropped = True
    ElseIf State = leaveSftBox Then
        ' Hide the drop down portion with a delay, in case the
        ' user is moving from/to the static or drop down portion
        ComboTarget.DropDown.RollUp 500  ' 1/2 second
    End If
End Sub

Private Sub ComboTarget_OLEDragDrop(Data As SftBoxLib50.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
    Dim ItemIndex As Long
    If Data.GetFormat(sftCFText) Then
        ItemIndex = ComboTarget.Items.Insert(Data.GetData(sftCFText), ComboTarget.Items.DropIndex)
        ComboTarget.Items.Selection = ItemIndex

C#

private void comboTarget_OLEDragOver(object sender, AxSftBoxLib50._ISftBoxEvents_OLEDragOverEvent e)
{
    if (e.state == SftBoxOLEDragOverConstants.enterSftBox) {
        // Show the drop down portion
        comboTarget.DropDown.Dropped = true;
    } else if (e.state == SftBoxOLEDragOverConstants.leaveSftBox) {
        // Hide the drop down portion with a delay, in case the
        // user is moving from/to the static or drop down portion
        comboTarget.DropDown.RollUp(500);  // 1/2 second
    }
}

private void comboTarget_OLEDragDrop(object sender, AxSftBoxLib50._ISftBoxEvents_OLEDragDropEvent e)
{
    if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFText)) {
        int itemIndex = comboTarget.Items.Insert(e.data.GetData(SftOLEClipboardConstants.sftCFText) as string, comboTarget.Items.DropIndex);

See Also SftBoxDropDown Object | Object Hierarchy


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