Defines the default font used to display cell text.
Get
| C# | System.Drawing.Font refFontObj = object.Font; |
| VB.NET | refFontObj = object.Font As System.Drawing.Font |
| C++ | IFontDisp* refFontObj = object->GetFont(); |
| C | HRESULT object->get_Font(IFontDisp** refFontObj); |
| VB | Set refFontObj = object.Font As IFontDisp |
Put
| C# | void object.let_Font(System.Drawing.Font refFontObj); |
| VB.NET | object.let_Font(ByVal refFontObj As System.Drawing.Font) |
| C++ | void object->PutFont(IFontDisp* refFontObj); |
| C | HRESULT object->put_Font(IFontDisp* refFontObj); |
| VB | object.Font = refFontObj As IFontDisp |
PutRef
| C# | System.Drawing.Font object.Font = refFontObj; |
| VB.NET | object.Font = refFontObj As System.Drawing.Font |
| C++ | void object->PutRefFont(IFontDisp* refFontObj); |
| C | HRESULT object->putref_Font(IFontDisp* refFontObj); |
| VB | Set object.Font = refFontObj As IFontDisp |
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 ...".
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.
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")
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)
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