ListingCode Membuat Pilihan Warna Pada VisualStudio




ListingCode Membuat Pilihan Warna Pada VisualStudio

ListingCode Membuat Pilihan Warna Pada VisualStudio




Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If RadioButton1.Checked = True Then
            MsgBox("Anda Memilih Warna Biru")
            Exit Sub
        ElseIf RadioButton2.Checked = True Then
            MsgBox("Anda Memilih Warna Merah")
            Exit Sub
        Else
            MsgBox("Anda Memilih Warna Hijau")
            Exit Sub
        End If
    End Sub


    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        If RadioButton1.Checked = True Then
            RadioButton1.ForeColor = Color.Blue
        Else
            RadioButton1.ForeColor = Color.Black
        End If
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        If RadioButton2.Checked = True Then
            RadioButton2.ForeColor = Color.Pink
        Else
            RadioButton2.ForeColor = Color.Black
        End If
    End Sub

    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        If RadioButton3.Checked = True Then
            RadioButton3.ForeColor = Color.Silver
        Else
            RadioButton3.ForeColor = Color.Black
        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

Hasilnya

Postingan terkait:

Belum ada tanggapan untuk "ListingCode Membuat Pilihan Warna Pada VisualStudio"

Post a Comment