Kamis, 15 November 2012

LISTING BANGUN DUA DIMENSI WARNA



LISTING BANGUN DUA DIMENSI WARNA


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "LINGKARAN" And TextBox2.Text = "MERAH" Then OvalShape1.Show()
        If TextBox1.Text = "LINGKARAN" And TextBox2.Text = "KUNING" Then OvalShape2.Show()
        If TextBox1.Text = "LINGKARAN" And TextBox2.Text = "HIJAU" Then OvalShape3.Show()
        If TextBox1.Text = "PERSEGI" And TextBox2.Text = "MERAH" Then RectangleShape1.Show()
        If TextBox1.Text = "PERSEGI" And TextBox2.Text = "KUNING" Then RectangleShape2.Show()
        If TextBox1.Text = "PERSEGI" And TextBox2.Text = "HIJAU" Then RectangleShape3.Show()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        ComboBox1.SelectedItem = Nothing
        ComboBox2.SelectedItem = Nothing
        OvalShape3.Hide()
        OvalShape2.Hide()
        OvalShape1.Hide()
        RectangleShape3.Hide()
        RectangleShape2.Hide()
        RectangleShape1.Hide()

    End Sub

 
    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged
        If ComboBox1.Text = "LINGKARAN" Then TextBox1.Text = "LINGKARAN" Else TextBox1.Text = "PERSEGI"
    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.TextChanged
        If ComboBox2.Text = "MERAH" Then TextBox2.Text = "MERAH"
        If ComboBox2.Text = "KUNING" Then TextBox2.Text = "KUNING"
        If ComboBox2.Text = "HIJAU" Then TextBox2.Text = "HIJAU"
    End Sub

    Private Sub OvalShape3_TEXTCHANGED(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Activated
        OvalShape3.Hide()

    End Sub

    Private Sub OvalShape2_TEXTCHANGED(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Activated
        OvalShape2.Hide()

    End Sub

    Private Sub OvalShape1_TEXTCHANGED(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Activated
        OvalShape1.Hide()

    End Sub

    Private Sub RectangleShape3_textchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Activated
        RectangleShape3.Hide()

    End Sub

    Private Sub RectangleShape2_textchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Activated
        RectangleShape2.Hide()

    End Sub

    Private Sub RectangleShape1_textchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Activated
        RectangleShape1.Hide()

    End Sub

End Class


Tidak ada komentar:

Posting Komentar