Font Constructor (Font, FontStyle)
Assembly: System.Drawing (in System.Drawing.dll)
For localized applications that are based on the .NET Framework 2.0 and earlier releases, specifying a font for prototype when that font has not been installed on the computer that is used to build your application will cause the Microsoft Sans Serif font to be used instead. If your application depends on this behavior and you must recompile your application for the .NET Framework 3.0, you should specify the Microsoft Sans Serif font for prototype.
The following code example demonstrates the Inequality operator, the Font constructor, and the Bold property. This example is designed to be used with a Windows Form that contains a button named Button2. Paste the following code into your form and associate the Button2_Click method with the button's Click event.
Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click If (Color.op_Inequality(Me.BackColor, SystemColors.ControlDark)) Then Me.BackColor = SystemColors.ControlDark End If If Not (Me.Font.Bold) Then Me.Font = New Font(Me.Font, FontStyle.Bold) End If End Sub
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.