HeaderPane
Main
Hide
Share Link
Print

DropDownOpening Event, SftBox Class

Occurs before the dropdown opens.

Class: SftBox
Namespace: Softelvdm.SftBoxNET
Assembly: Softelvdm.SftBoxNET

Syntax

public event CancelEventHandler DropDownOpening;
Public Event DropDownOpening As CancelEventHandler

Comments

Occurs before the dropdown opens.

Setting the Cancel property of the event data to True keeps the dropdown closed. The list can be filled here.

Examples

C# View entire sample code

        }

        private void sftBox1_TextChanged(object sender, EventArgs e) {
            DumpValues("sftBox1.TextChanged (" + sftBox1.Text + ")", e);
        }

        private void sftBox1_DropDownOpening(object sender, CancelEventArgs e) {
            e.Cancel = checkBlock.Checked;
            DumpValues("sftBox1.DropDownOpening" + (e.Cancel ? " (canceled)" : ""), e);
        }

        private void sftBox1_DropDownOpened(object sender, EventArgs e) {
            DumpValues("sftBox1.DropDownOpened", e);
        }

        private void sftBox1_DropDownClosed(object sender, DropDownClosedEventArgs e) {

VB.NET View entire sample code

    Private Sub SftBox1_EditTextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SftBox1.EditTextChanged
        DumpValues("SftBox1.EditTextChanged (" + SftBox1.Text + ")", e)
    End Sub

    Private Sub SftBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SftBox1.TextChanged
        DumpValues("SftBox1.TextChanged (" + SftBox1.Text + ")", e)
    End Sub

    Private Sub SftBox1_DropDownOpening(ByVal sender As Object, ByVal e As CancelEventArgs) Handles SftBox1.DropDownOpening
        e.Cancel = CheckBlock.Checked
        DumpValues("SftBox1.DropDownOpening" + If(e.Cancel, " (canceled)", ""), e)
    End Sub

    Private Sub SftBox1_DropDownOpened(ByVal sender As Object, ByVal e As EventArgs) Handles SftBox1.DropDownOpened
        DumpValues("SftBox1.DropDownOpened", e)
    End Sub

See Also SftBox Class | Classes | SftBox/NET 3.0