控件应用:代码实现详解(第六讲)
字体设置代码示例
本例展示如何通过代码动态修改文本框字体。
' 定义全局变量
Dim intFontSize As Integer
Dim bFontItalic As System.Drawing.FontStyle
Dim bFontBold As System.Drawing.FontStyle
Dim strFontName As String
' 定义子过程,用于设置文本框字体
Private Sub FontSet()
TextBox1.Font = New Font(strFontName, intFontSize, bFontItalic Or bFontBold)
End Sub
下载地址
用户评论