Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBox.Font Property

Defines the default font used to display cell text.

Syntax

Get

VB.NETrefFontObj = object.Font As System.Drawing.Font
VBSet refFontObj = object.Font As IFontDisp
C#.NETSystem.Drawing.Font refFontObj = object.Font;
VC++IFontDisp* refFontObj = object->GetFont();
CHRESULT object->get_Font(IFontDisp** refFontObj);

Put

VB.NETobject.let_Font(ByVal refFontObj As System.Drawing.Font)
VBobject.Font = refFontObj As IFontDisp
C#.NETvoid object.let_Font(System.Drawing.Font refFontObj);
VC++void object->PutFont(IFontDisp* refFontObj);
CHRESULT object->put_Font(IFontDisp* refFontObj);

PutRef

VB.NETobject.Font = refFontObj As System.Drawing.Font
VBSet object.Font = refFontObj As IFontDisp
C#.NETSystem.Drawing.Font object.Font = refFontObj;
VC++void object->PutRefFont(IFontDisp* refFontObj);
CHRESULT object->putref_Font(IFontDisp* refFontObj);

object

A SftBox object.

refFontObj

Defines the default font used to display cell text. For information about font properties, please visit the applicable section "Using SftBox/OCX with ...".

Comments

The Font property defines the default font used to display cell text.

The Cell.Font property can be used to override an individual cell's font. The Headers.Font and RowHeaders.Font properties are used to define the fonts used to display the column and row headers.

The font used for the edit control portion is defined using the Edit.Font property.

Examples

VB.NET

Private Sub closeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closeButton.Click
    Application.Exit()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    BoldFont = New Font(SftBox1.Font, FontStyle.Bold)
    ItalicFont = New Font("Arial", 8, FontStyle.Italic)

    Dim index As Integer
    SftBox1.BulkUpdate = True
    For index = 0 To 29
        If index = 4 Then
            AddOneItem("Item " & index, "This cell text is very long", "Cell " & index & ",2")
        ElseIf index = 7 Then
            AddOneItem("Item " & index, "Cell " & index & ",1", "This cell text is also very long")

C#

private void closeButton_Click(object sender, System.EventArgs e)
{
    Application.Exit();
}

private void Form1_Load(object sender, System.EventArgs e)
{
    BoldFont = new Font(SftBox1.Font, FontStyle.Bold);
    ItalicFont = new Font("Arial", 8, FontStyle.Italic);

    int index;
    SftBox1.BulkUpdate = true;
    for (index = 0 ; index < 30 ; ++index) {
        if (index == 4)
            AddOneItem("Item " + index, "This cell text is very long", "Cell " + index + ",2");
        else if (index == 7)

C++

    ASSERT(SUCCEEDED(hr));
    PictDesc.bmp.hbitmap = LoadBitmap(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDB_PIN));
    hr = OleCreatePictureIndirect(&PictDesc, IID_IPictureDisp, TRUE, (void**)&m_pIPictureDispPin);
    ASSERT(SUCCEEDED(hr));
    PictDesc.bmp.hbitmap = LoadBitmap(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDB_SPECIAL));
    hr = OleCreatePictureIndirect(&PictDesc, IID_IPictureDisp, TRUE, (void**)&m_pIPictureDispSpecial);
    ASSERT(SUCCEEDED(hr));

    vBox1->putref_Font(NULL); // use the form's default font
    vBox1->Edit->putref_Font(NULL);
    vBox1->RowHeaders->putref_Font(NULL);
    // make a bold font
    IFontPtr pFont = vBox1->GetFont();
    IFontPtr pFontNew;
    hr = pFont->Clone(&pFontNew);
    ASSERT(SUCCEEDED(hr));

See Also SftBox Object | Object Hierarchy


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