Selasa, 17 Desember 2013

Pemograman Font Property VB.2008

Design Form Pemograman Font Property


Listing Program

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label2.Text = TextBox1.Text
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        Label2.ForeColor = Color.Red
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        Label2.ForeColor = Color.Green
    End Sub

    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        Label2.ForeColor = Color.Blue
    End Sub

    Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
        Label2.ForeColor = Color.Yellow
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked Then
            Label2.Font = New Font(Label2.Font, Label2.Font.Style Or FontStyle.Italic)
        Else
            Label2.Font = New Font(Label2.Font, Label2.Font.Style And Not FontStyle.Italic)
        End If

    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.Checked Then
            Label2.Font = New Font(Label2.Font, Label2.Font.Style Or FontStyle.Bold)
        Else
            Label2.Font = New Font(Label2.Font, Label2.Font.Style And Not FontStyle.Bold)
        End If

    End Sub

    Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
        If CheckBox3.Checked Then
            Label2.Font = New Font(Label2.Font, Label2.Font.Style Or FontStyle.Underline)
        Else
            Label2.Font = New Font(Label2.Font, Label2.Font.Style And Not FontStyle.Underline)
        End If

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        End
    End Sub
End Class



Hasil Pemograman Font Property


Tidak ada komentar:

Posting Komentar