top of page

The Code

 

 

 

Public Class Form86

 

    '## Sub Routines are added to [If... Then... Else] Statements ##
    '## Re-Define Clarity of Program Flow in Event Handle Procedure ##

    '## Private Sub Rountine Checkbox1_CheckedChanged ##
    '## Alternates Label1.Text Font to Bold as Checked ##
    '## Alternates Label1.Text Font to Un-Bold as Un-Checked ##


    Private Sub Checkbox1_CheckedChangedBoldFont(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged

        If CheckBox1.Checked Then

            '## [1] Sub Routine FontStyleBold() ##
            FontstyleBold()

        Else


            '## [2] Sub Rountine UnFontStyleBold() ##
            UnFontStyleBold()

        End If

    End Sub

    '## Private Sub Rountine Checkbox1_CheckedChanged ##
    '## Alternates Label1.Text Font to Italic as Checked ##
    '## Alternates Label1.Text Font to Un-Italic as Un-Checked ##

    Private Sub Checkbox2_CheckedChangedItalicFont(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged

        If CheckBox2.Checked Then

            '## [3] Sub Rountine FontStyleItalic() ##
            FontStyleItalic()

        Else


            '## [4] Sub Routine UnFontStyleItalic() ##
            UnFontStyleItalic()

        End If

    End Sub

    '## Private Sub Rountine Checkbox1_CheckedChanged ##
    '## Alternates Label1.Text Font to Underline as Checked ##
    '## Alternates Label1.Text Font to Un-Underline as Un-Checked ##

    Private Sub Checkbox3_CheckedChangedUnderlineFont(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged

        If CheckBox3.Checked Then

            '## [5] Sub Rountine FontStyleUnderline() ##
            FontStyleUnderline()

        Else


            '## [6] Sub Routine UnFontStyleUnderline() ##
            UnFontStyleUnderline()

        End If

    End Sub

    Private Sub Checkbox4_CheckedChangedUnderlineFont(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged

        If CheckBox4.Checked Then

            '## [7] Sub Routine FontStyleStrikeout () ##
            FontStyleStrikeout()

        Else


            '## [8] Sub Routine UnFontStyleStrikeout () ##
            UnFontStyleStrikeout()

        End If

    End Sub

 

    '## Sub [1] ##
    Sub FontstyleBold()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Bold)
        End Sub


    '## Sub [2] ##
    Sub UnFontStyleBold()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style And Not FontStyle.Bold)
    End Sub

 

 

    '## Sub [3] ##
    Sub FontStyleItalic()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Italic)
    End Sub


    '## Sub [4] ##
    Sub UnFontStyleItalic()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style And Not FontStyle.Italic)
    End Sub

 

 

    '## Sub [5] ##
    Sub FontStyleUnderline()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Underline)
    End Sub


    '## Sub [6] ##
    Sub UnFontStyleUnderline()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style And Not FontStyle.Underline)
    End Sub

 

 

    '## Sub [7] ##
    Sub FontStyleStrikeout()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Strikeout)
    End Sub


    '## Sub [8] ##
    Sub UnFontStyleStrikeout()
       
Label1.Font = New Font(Label1.Font, Label1.Font.Style And Not FontStyle.Strikeout)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        '## Clear CheckBox Values ##

        CheckBox1.Checked = False  '## Bold ##
        CheckBox2.Checked = False  '## Italic ##
        CheckBox3.Checked = False  '## Underline ##
        CheckBox4.Checked = False  '## Strikeout ##

    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

        '## Revert Back to Index Menu ##

        Form81.Show()
        Me.Hide()

    End Sub


End Class

 

Website Links-173.jpg
bottom of page