HeaderPane
Main
Hide
Share Link
Print

SelectedItem Property, SftBox Class

Defines the selected item.

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

Syntax

public ItemClass SelectedItem { get; set; }
Public Property SelectedItem As ItemClass

Value

The selected item, or null/Nothing if no item is selected.

Comments

Defines the selected item.

Selecting an item shows its text in the edit field. The SftBox.SelectedItemChanged event occurs when the selection changes, the SftBox.SelectionCommitted event only when the user chose the item.

Examples

C# View entire sample code

        private SftBox[] boxes;
        private Order order = new Order();
        private Font previewFont;

        public Form1() {
            InitializeComponent();
            boxes = new SftBox[] { sftBox1, sftBox2, sftBox3, sftBox4, sftBox5, sftBox6, sftBox7 };

            sftBox1.SelectedItem = sftBox1.Items[5];
            sftBox2.SelectedItem = sftBox2.Items[0].Children[1];

            // with the Build phase collapsed, the rows shown, all items and the outline are numbered differently
            sftBox7.Items[1].Collapse(CollapseStyleEnum.All);

            // the installed fonts, each name shown in its own font, with an image for TrueType and OpenType fonts
            sftBox3.FillFontNames(FontListOptionsEnum.ShowInFont | FontListOptionsEnum.ShowTypeImage);

VB.NET View entire sample code

    Private boxes() As SftBox
    Private order As New Order()
    Private previewFont As Font

    Public Sub New()
        InitializeComponent()
        boxes = New SftBox() {SftBox1, SftBox2, SftBox3, SftBox4, SftBox5, SftBox6, SftBox7}

        SftBox1.SelectedItem = SftBox1.Items(5)
        SftBox2.SelectedItem = SftBox2.Items(0).Children(1)

        ' with the Build phase collapsed, the rows shown, all items and the outline are numbered differently
        SftBox7.Items(1).Collapse(CollapseStyleEnum.All)

        ' the installed fonts, each name shown in its own font, with an image for TrueType and OpenType fonts
        SftBox3.FillFontNames(FontListOptionsEnum.ShowInFont Or FontListOptionsEnum.ShowTypeImage)

See Also SftBox Class | Classes | SftBox/NET 3.0