VB.NET 设置Label字体

        '==========================改变字体
        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


 

你可能感兴趣的:(VB.NET 设置Label字体)