HeaderPane
Main
Hide
Share Link
Print

SelectedItemChanged Event, SftBox Class

Occurs when the selected item changes, under program control or by the user.

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

Syntax

public event EventHandler SelectedItemChanged;
Public Event SelectedItemChanged As EventHandler

Comments

Occurs when the selected item changes, under program control or by the user.

Examples

C# View entire sample code

        // The text of the selected item, as the combo box shows it
        private string Selection(SftBox box) {
            return box.SelectedItem == null ? "none" : box.DisplayText(box.SelectedItem);
        }

        // sftBox1 - an edit field with a dropdown; typing completes the name of a fruit

        private void sftBox1_SelectedItemChanged(object sender, EventArgs e) {
            DumpValues("sftBox1.SelectedItemChanged (" + Selection(sftBox1) + ")", e);
        }

        private void sftBox1_SelectionCommitted(object sender, EventArgs e) {
            DumpValues("sftBox1.SelectionCommitted (" + Selection(sftBox1) + ")", e);
        }

        private void sftBox1_SelectedValueChanged(object sender, EventArgs e) {

VB.NET View entire sample code

        If box.SelectedItem Is Nothing Then
            Return "none"
        End If
        Return box.DisplayText(box.SelectedItem)
    End Function

    ' SftBox1 - an edit field with a dropdown; typing completes the name of a fruit

    Private Sub SftBox1_SelectedItemChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SftBox1.SelectedItemChanged
        DumpValues("SftBox1.SelectedItemChanged (" + Selection(SftBox1) + ")", e)
    End Sub

    Private Sub SftBox1_SelectionCommitted(ByVal sender As Object, ByVal e As EventArgs) Handles SftBox1.SelectionCommitted
        DumpValues("SftBox1.SelectionCommitted (" + Selection(SftBox1) + ")", e)
    End Sub

See Also SftBox Class | Classes | SftBox/NET 3.0