本文整理匯總了VB.NET中System.Windows.Forms.FontDialog.ShowApply屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET FontDialog.ShowApply屬性的具體用法?VB.NET FontDialog.ShowApply怎麽用?VB.NET FontDialog.ShowApply使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Windows.Forms.FontDialog
的用法示例。
在下文中一共展示了FontDialog.ShowApply屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Sets the ShowApply property, then displays the dialog.
FontDialog1.ShowApply = True
FontDialog1.ShowDialog()
End Sub
Private Sub FontDialog1_Apply(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontDialog1.Apply
' Applies the selected font to the selected text.
RichTextBox1.SelectionFont = FontDialog1.Font
End Sub
示例2: FontDialogProperty
' 導入命名空間
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