'==========================改变字体
Dim myFont As System.Drawing.Font
Dim strName As String = ListBox1.Text
Dim myFontFamily As System.Drawing.FontFamily
myFontFamily = New FontFamily(strName)
Dim myFontStyle As FontStyle
Dim bolBold = CheckBox1.Checked
If bolBold Then
myFontStyle = myFontStyle Or FontStyle.Bold
End If
Dim bolItdic = CheckBox2.Checked
If bolItdic Then
myFontStyle = myFontStyle Or FontStyle.Italic
End If
Dim bolUnderline = CheckBox3.Checked
If bolUnderline Then
myFontStyle = myFontStyle Or FontStyle.Underline
End If
Dim bolStrikeout = CheckBox4.Checked
If bolStrikeout Then
myFontStyle = myFontStyle Or FontStyle.Strikeout
End If
Dim sngSize = ComboBox11.Text
Dim myColor As Color
myFont = New System.Drawing.Font(myFontFamily, sngSize, myFontStyle, System.Drawing.GraphicsUnit.Point)
Label69.Font = myFont
myColor = Label77.BackColor
Label69.ForeColor = myColor
本文介绍了一种使用Visual Basic .NET来改变文本标签字体的方法,包括如何从下拉列表框中选择字体名称、大小及设置字体样式(如粗体、斜体等),同时还演示了如何更改字体颜色。
1290

被折叠的 条评论
为什么被折叠?



