property Edit.Font as IFontDisp
Retrieves or sets the control's font.

 TypeDescription 
   IFontDisp A font object that indicates the control's font.  

Specifies the control's font. Use the LineNumberFont property to specify the font for the control's line numbers bar. Use the Refresh method to update the control's content. Use the Font property to assign a font to the control in design mode. The Font property adjusts the height of the line too.

The following VB sample assigns by code a new font to the control:

With Edit1
    With .Font
        .Name = "Tahoma"
    End With
    .Refresh
End With

The following C++ sample assigns by code a new font to the control:

COleFont font = m_edit.GetFont();
font.SetName( "Tahoma" );
m_edit.Refresh();

the C++ sample requires definition of COleFont class ( #include "Font.h" )

The following VB.NET sample assigns by code a new font to the control:

With AxEdit1
    Dim font As System.Drawing.Font = New System.Drawing.Font("Tahoma", 10, FontStyle.Regular, GraphicsUnit.Point)
    .Font = font
    .CtlRefresh()
End With

The following C# sample assigns by code a new font to the control:

System.Drawing.Font font = new System.Drawing.Font("Tahoma", 10, FontStyle.Regular);
axEdit1.Font = font;
axEdit1.CtlRefresh();

The following VFP sample assigns by code a new font to the control:

with thisform.Edit1.Object
	.Font.Name = "Tahoma"
	.Refresh()
endwith

The following Template sample assigns by code a new font to the control:

Font
{
	Name = "Tahoma"
}

Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.