HeaderPane
Main
Hide
Share Link
Print

FillFontNames Method, SftBox Class

Fills the list with the names of the fonts installed on the system.

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

Syntax

public void FillFontNames( FontListOptionsEnum options );
Public Sub FillFontNames( ByVal options As FontListOptionsEnum )

Parameters

options

Which fonts are listed and how they are shown.

Comments

Fills the list with the names of the fonts installed on the system.

The list is cleared first. Each item's ItemClass.DataItem is the FontFamily, so SftBox.SelectedValue returns the selected family (with an empty SftBox.ValueMember). The list cannot be filled while a data source is bound (SftBox.DataSource property).

Examples

C# View entire sample code

            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);
            sftBox3.Text = "Segoe UI";
            if (sftBox3.SelectedItem == null && sftBox3.Items.Count > 0)
                sftBox3.SelectedItem = sftBox3.Items[0];

            BindLookup();

            FillCombo(comboSearch, typeof(SearchModeEnum), sftBox5.SearchMode);
            FillCombo(comboAlignment, typeof(DropDownAlignmentEnum), sftBox1.DropDownAlignment);

VB.NET View entire sample code

        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)
        SftBox3.Text = "Segoe UI"
        If SftBox3.SelectedItem Is Nothing AndAlso SftBox3.Items.Count > 0 Then
            SftBox3.SelectedItem = SftBox3.Items(0)
        End If

        BindLookup()

        FillCombo(ComboSearch, GetType(SearchModeEnum), SftBox5.SearchMode)

See Also SftBox Class | Classes | SftBox/NET 3.0