HeaderPane
Main
Hide
Share Link
Print

SftBox.Font Property

Defines the default font used to display cell text.

Syntax

Get

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

Put

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

PutRef

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

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 View entire sample code

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# View entire sample code

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++ View entire sample code

    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 11/04/2026 - (email)
© 2026 Softel vdm, Inc.