本文整理汇总了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