1,451
社区成员
发帖
与我相关
我的任务
分享
With Label1.Font
Label1.Font = New System.Drawing.Font(.FontFamily, .Size + 10, .Style, .Unit)
End With
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.AutoSize = vbTrue
Dim MyFont As System.Drawing.Font
Dim MyFontName As String
MyFontName = "黑体"
Dim MyFontStyle As FontStyle
Dim sngSize = 48
Dim intStyle = True
Dim bolUnder = True
Dim bolStrike = True
Dim intColorR = 20
Dim intColorG = 20
Dim intColorB = 20
If bolUnder Then
myFontStyle = myFontStyle Or FontStyle.Underline
End If
If bolStrike Then
myFontStyle = myFontStyle Or FontStyle.Strikeout
End If
If intStyle Then
myFontStyle = myFontStyle Or FontStyle.Bold Or FontStyle.Italic
End If
Dim myColor As Color
myColor = Color.FromArgb(RGB(intColorR, intColorG, intColorB))
'myColor = RGB(intColorR, intColorG, intColorB)
Dim myFontFamily As System.Drawing.FontFamily
myFontFamily = New FontFamily(MyFontName)
myFont = New System.Drawing.Font(myFontFamily, sngSize, myFontStyle, System.Drawing.GraphicsUnit.Point)
Label1.Font = myFont
Label1.ForeColor = myColor
End Sub
End Class