Senin, 10 April 2017

Contoh Penggunaan Group Box, Radio Button & Check Box pada Visual Studio 2015



KODINGNYA :

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label3.Text = "Membuat Style Font"
        Label2.Text = "Isikan Kalimat"
        Label1.Text = ""
        RadioButton1.Text = "Merah"
        RadioButton2.Text = "Biru"
        RadioButton3.Text = "Hijau"
        RadioButton4.Text = "Coklat"
        CheckBox1.Text = "Bold"
        CheckBox2.Text = "Italic"
        CheckBox3.Text = "StrikeOut"
        CheckBox4.Text = "Underline"
        Button1.Text = "Jalankan"
        GroupBox1.Text = "Masukan Data"
        GroupBox2.Text = "Pilihan Kata"
    End Sub

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

    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
        Label1.ForeColor = Color.Chocolate
    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
        Label1.ForeColor = Color.Green
    End Sub

    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
        Label1.ForeColor = Color.Blue
    End Sub

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

    Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Underline)
    End Sub

    Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Strikeout)
    End Sub

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Bold)
    End Sub

    Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
        Label1.Font = New Font(Label1.Font, Label1.Font.Style Or FontStyle.Italic)
    End Sub
End Class


0 komentar:

Posting Komentar