Gets or returns the font object used to print the control text.
Syntax
Visual Basic (Declaration) | |
---|
Public Property Font As Font |
C# | |
---|
public Font Font {get; set;} |
Property Value
System.Drawing.Font. Current Font object used to render the control's text.
Example
C# | Copy Code |
---|
private void detail_Format(object sender, System.EventArgs eArgs)
{
this.label1.BackColor = System.Drawing.Color.BlanchedAlmond;
this.label1.Font = new System.Drawing.Font("Arial",12);
this.label1.ForeColor = System.Drawing.Color.Brown;
//With the properties above set, the Style string would be:
//this.label1.Style = color: Brown; background-color: BlanchedAlmond; font-size: 12pt;
} |
Visual Basic | Copy Code |
---|
Private Sub Detail1_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail1.Format
Me.Label1.BackColor = System.Drawing.Color.BlanchedAlmond
Me.Label1.Font = New System.Drawing.Font("Arial", 12)
Me.Label1.ForeColor = System.Drawing.Color.Brown
'With the properties above set, the Style string would be:
'this.Label1.Style = color: Brown; background-color: BlanchedAlmond; font-size: 12pt;
End Sub |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also