Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBoxEdit.Text Property

Defines the edit control portion's text contents.

Syntax

Get

VB.NETText = object.Text As String
VBText = object.Text As String
C#.NETstring Text = object.Text;
VC++_bstr_t Text = object->Text;
_bstr_t Text = object->GetText();
CHRESULT object->get_Text(BSTR* Text);

Put

VB.NETobject.Text = Text As String
VBobject.Text = Text As String
C#.NETstring object.Text = Text;
VC++_bstr_t object->Text = Text;
void object->PutText(_bstr_t Text);
CHRESULT object->put_Text(BSTR Text);

object

A SftBoxEdit object.

Text

Defines the edit control portion's text contents.

Comments

The Text property defines the edit control portion's text contents.

The Text property contains the text contents in the edit control portion of a simple or drop down combo box. The text can be replaced by assigning a new text value to the Text property.

In a drop down list combo box, the Text property contains the text of the currently selected item (its first displayed column). In this case the property cannot be updated.

The Edit.SelText property defines the currently selected text of the edit control portion.

Examples

VB.NET

    fontNames.BulkUpdate = False
    fontNames.Columns.MakeOptimal(0)
    fontNames.Items.RecalcHorizontalExtent(0)
End Sub

Private Sub UpdateFontStyles()
    ' add all styles for the current font name
    If fontNames.Items.Selection >= 0 Then
        Dim OldText As String = fontStyles.Edit.Text
        fontStyles.Items.AddFontStyles(fontNames.get_Cell(fontNames.Items.Selection, 0).Text, 0, "", "")
        Dim index As Integer = fontStyles.Items.Find(OldText, 0, 0, False, True, True)
        If index < 0 Then index = 0
        fontStyles.Items.Selection = index
    Else
        fontStyles.Items.Clear()
    End If

VB6

        PerformSort FontNames
    End If
End Sub

Private Sub UpdateStyles()
    Dim OldText As String, Index As Long
    ' add all styles for the current font name
    If FontNames.Items.Selection >= 0 Then
        OldText = FontStyles.Edit.Text
        FontStyles.Items.AddFontStyles FontNames.Cell(FontNames.Items.Selection, 0).Text, 0, "", ""
        Index = FontStyles.Items.Find(OldText, 0, 0, False, True, True)
        If Index < 0 Then Index = 0
        FontStyles.Items.Selection = Index
    Else
        FontStyles.Items.Clear
    End If

C#

    fontNames.Columns.MakeOptimal(0);
    fontNames.Items.RecalcHorizontalExtent(0);
}

private void UpdateFontStyles()
{
    // add all styles for the current font name
    if (fontNames.Items.Selection >= 0) {
        string OldText = fontStyles.Edit.Text;
        fontStyles.Items.AddFontStyles(fontNames.get_Cell(fontNames.Items.Selection,0).Text, 0, "", "");
        int index = fontStyles.Items.Find(OldText, 0, 0, false, true, true);
        if (index < 0) index = 0;
        fontStyles.Items.Selection = index;
    } else
        fontStyles.Items.Clear();
    PerformSort(fontStyles, SftBoxSortConstants.sortSftBoxAscending);

C++

void CFontDlgDlg::UpdateFontStyles()
{
    // add all styles for the current font name
    ISftBoxPtr vFontNames = m_FontNames.GetControlUnknown();
    ISftBoxPtr vFontStyles = m_FontStyles.GetControlUnknown();

    if (vFontNames->Items->Selection >= 0) {
        CString OldText((LPCTSTR) vFontStyles->Edit->Text);
        vFontStyles->Items->AddFontStyles(vFontNames->Cell[vFontNames->Items->Selection][0]->Text, 0, "", "");
        long index;
        vFontStyles->Items->raw_Find((_bstr_t)OldText, 0, 0, VARIANT_FALSE, VARIANT_TRUE, VARIANT_TRUE, &index);
        if (index < 0) index = 0;
        vFontStyles->Items->Selection = index;
    } else
        vFontStyles->Items->Clear();
    PerformSort(vFontStyles, sortSftBoxAscending);

See Also SftBoxEdit Object | Object Hierarchy


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