Set Properties for a FontDialog : FontDialog « GUI « VB.Net Tutorial






Set Properties for a FontDialog
Imports System.Drawing
Imports System.Windows.Forms

public class FontDialogProperty
   public Shared Sub Main


        Dim FontDialog1 As FontDialog = New System.Windows.Forms.FontDialog
        
        Dim objNewFont As Font

        objNewFont = New Font("Verdana", 12, FontStyle.Underline)
        With FontDialog1
            .Font = objNewFont
            .AllowScriptChange = False
            .ShowColor = True
            .Color = Color.Blue
            .ShowApply = True
            '.ShowEffects = False
        End With

        If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            Console.WriteLine(FontDialog1.Font)
            Console.WriteLine(FontDialog1.Color)
        End If

   End Sub
End class








14.71.FontDialog
14.71.1.Font dialog apply actionFont dialog apply action
14.71.2.Font dialog showing effectsFont dialog showing effects
14.71.3.Set Properties for a FontDialogSet Properties for a FontDialog
14.71.4.Get selected font from FontDialog
14.71.5.Use Font dialog to set Label fontUse Font dialog to set Label font