ANALISIS PROGRAM MENGENAL BENTUK DAN WARNA (bagian 2)


4.      Cara Menampilkan Hasil Pilihan Warna dan Bentuk (Lingkaran)




Komponen toolbox yang digunakan :
Form3
Form3
Name
Text
Form3
Lingkaran

OvalShape
Name
Ovalshape7

Button1
Name
Text
Button 1
Back

Public Class Form3

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form2.Hide()
        My.Computer.Audio.Play("C:\Windows\media\tada.wav")
        If Form2.ComboBox2.Text = ("Hijau") Then
            OvalShape1.FillColor = Color.Green
            Label1.ForeColor = Color.Green
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Merah") Then
            OvalShape1.FillColor = Color.Red
            Label1.ForeColor = Color.Red
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Kuning") Then
            OvalShape1.FillColor = Color.Yellow
            Label1.ForeColor = Color.Yellow
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Biru") Then
            OvalShape1.FillColor = Color.Blue
            Label1.ForeColor = Color.Blue
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Pink") Then
            OvalShape1.FillColor = Color.Pink
            Label1.ForeColor = Color.Pink
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Ungu") Then
            OvalShape1.FillColor = Color.Purple
            Label1.ForeColor = Color.Purple
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Jingga") Then
            OvalShape1.FillColor = Color.Orange
            Label1.ForeColor = Color.Orange
            BackColor = Color.Purple
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.Show()
        Me.Close()
    End Sub

    Private Sub OvalShape1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OvalShape1.Click

    End Sub
End Class

5.      Cara Menampilkan Hasil Pilihan Warna dan Bentuk (Persegi)



Komponen toolbox yang digunakan :
Form4
Form4
Name
Text
Form4
Persegi

RectangleShape
Name
Rectangleshape7

Button1
Name
Text
Button 1
Back

Public Class Form4

    Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form2.Hide()
        My.Computer.Audio.Play("C:\Windows\media\tada.wav")
        If Form2.ComboBox2.Text = ("Merah") Then
            RectangleShape1.FillColor = Color.Red
            Label1.ForeColor = Color.Red
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Kuning") Then
            RectangleShape1.FillColor = Color.Yellow
            Label1.ForeColor = Color.Yellow
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Hijau") Then
            RectangleShape1.FillColor = Color.Green
            Label1.ForeColor = Color.Green
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Biru") Then
            RectangleShape1.FillColor = Color.Blue
            Label1.ForeColor = Color.Blue
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Pink") Then
            RectangleShape1.FillColor = Color.Pink
            Label1.ForeColor = Color.Pink
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Ungu") Then
            RectangleShape1.FillColor = Color.Purple
            Label1.ForeColor = Color.Purple
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Jingga") Then
            RectangleShape1.FillColor = Color.Orange
            Label1.ForeColor = Color.Orange
            BackColor = Color.Purple
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.Show()
        Me.Close()
    End Sub

    Private Sub RectangleShape1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RectangleShape1.Click

    End Sub
End Class

6.      Cara Menampilkan Hasil Pilihan Bentuk dan Warna (Persegi Panjang)



Komponen toolbox yang digunakan :
Form6
Form6
Name
Text
Form6
Are You Sure?

Label1
Name
Text
Label 1
Apakah Kamu Yakin Untuk Keluar?

Button1
Name
Text
Button 1
YA!

Button2
Name
Text
Button 2
TIDAK

Public Class Form5

    Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form2.Hide()
        My.Computer.Audio.Play("C:\Windows\media\tada.wav")
        If Form2.ComboBox2.Text = ("Merah") Then
            RectangleShape1.FillColor = Color.Red
            Label1.ForeColor = Color.Red
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Kuning") Then
            RectangleShape1.FillColor = Color.Yellow
            Label1.ForeColor = Color.Yellow
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Hijau") Then
            RectangleShape1.FillColor = Color.Green
            Label1.ForeColor = Color.Green
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Biru") Then
            RectangleShape1.FillColor = Color.Blue
            Label1.ForeColor = Color.Blue
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Pink") Then
            RectangleShape1.FillColor = Color.Pink
            Label1.ForeColor = Color.Pink
            BackColor = Color.Purple
        ElseIf Form2.ComboBox2.Text = ("Ungu") Then
            RectangleShape1.FillColor = Color.Purple
            Label1.ForeColor = Color.Purple
            BackColor = Color.Chartreuse
        ElseIf Form2.ComboBox2.Text = ("Jingga") Then
            RectangleShape1.FillColor = Color.Orange
            Label1.ForeColor = Color.Orange
            BackColor = Color.Purple
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.Show()
        Me.Close()
    End Sub
End Class

0 Response to "ANALISIS PROGRAM MENGENAL BENTUK DAN WARNA (bagian 2)"

Posting Komentar