property ComboBox.Font as IFontDisp

Retrieves or sets the control's font.

TypeDescription
IFontDisp A Font object that specifies the control's font.

Use the Font property to change the control's font. Use the ItemFont property to assign a different font to an item. Use the CellFont property to assign a different font to the cell. You can change the control's font using options described here. Use the <b>, <s>, ... built-in HTML tags to display in bold, ... portions of text using the HTMLCaption property and CellCaption property as well. Use the FilterBarFont property to change the control's filter bar font. Use the Font property to assign a font to the control at design time. The Locked property recreates the edit controls in the control's label area, if the Style property is DropDown.

The following VB sample changes the control's font at runtime:

With ComboBox1.Font
    .Name = "Comic Sans MS"
    .Bold = True
End With
ComboBox1.Locked = ComboBox1.Locked

The following C++ sample changes the control's font at runtime:

#include "font.h"
COleFont font = m_combobox.GetFont();
font.SetName("Comic Sans MS");
font.SetBold( TRUE );
m_combobox.SetLocked( m_combobox.GetLocked() );

The following VB.NET sample changes the control's font at runtime:

AxComboBox1.Font = New System.Drawing.Font("Comic Sans MS", 10, FontStyle.Bold)
AxComboBox1.Locked = AxComboBox1.Locked

The following C# sample changes the control's font at runtime:

axComboBox1.Font = new System.Drawing.Font("Comic Sans MS", 10, FontStyle.Bold);
axComboBox1.Locked = axComboBox1.Locked;

The following VFP sample changes the control's font at runtime:

With thisform.ComboBox1.Font
    .Name = "Comic Sans MS"
    .Bold = .t.
EndWith
thisform.ComboBox1.Locked = thisform.ComboBox1.Locked