TUTORIAL
MEMILIH BENTUK DAN WARNA
1. Deskripsi
Program yang
kami buat ini adalah program yang dapat memberi pilihan dan menunjukan gambar
serta warna yang ingin kita pilih.
2. Tujuan dan
Manfaat
Tujuan dari
program ini adalah memberi informasi bentuk dan warna agar kita dapat mengenal
bentuk dan warna tersebut.
3. Sasaran
Anak kecil atau balita
untuk mengenalkan bentuk dan warna dengan mudah dan cepat dan mudah.
Langkah awal adalah buka dahulu Visual Basic 2010 :
Form1 :
Komponen Toolbox yang digunakan sebagai berikut :
No
|
Komponen
|
Properties
|
keterangan
|
1
|
Form1
|
Name
|
Form1
|
Text
|
Program Bangun 2 Dimensi
|
||
Background
|
|
||
Display
|
CentertoScreen
|
||
2
|
Label 1
|
Name
|
Label 1
|
Text
|
Silahkan Pilih Bentuk
|
||
3
|
Label 2
|
Name
|
Label 2
|
Text
|
Silahkan Pilih Warna
|
||
4
|
TextBox1
|
Name
|
TextBox1
|
Text
|
|
||
Text Align
|
Left
|
||
Font
|
Microsoft sans Serif,8 pt
|
||
6
|
ComboBox1
|
Name
|
ComboBox1
|
Item
|
Lingkaran, Persegi
|
||
7
|
ComboBox2
|
Name
|
ComboBox2
|
Item
|
Merah, Kuning, Hijau, Biru
|
||
8
|
Button1
|
Name
|
Button1
|
Text
|
Buat
|
Listingnya :
Public Class Form1
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
If
ComboBox1.Text = "Lingkaran" And
ComboBox2.Text = "Merah" Then
OvalShape1.Visible = True
OvalShape2.Visible = False
OvalShape3.Visible = False
OvalShape4.Visible = False
RectangleShape1.Visible = False
RectangleShape2.Visible = False
RectangleShape3.Visible = False
RectangleShape4.Visible = False
ElseIf
ComboBox1.Text = "Lingkaran" And
ComboBox2.Text = "Kuning" Then
OvalShape1.Visible = False
OvalShape2.Visible = True
OvalShape3.Visible = False
OvalShape4.Visible = False
RectangleShape1.Visible = False
RectangleShape2.Visible = False
RectangleShape3.Visible = False
RectangleShape4.Visible = False
ElseIf
ComboBox1.Text = "Lingkaran" And
ComboBox2.Text = "Hijau" Then
OvalShape1.Visible = False
OvalShape2.Visible = False
OvalShape3.Visible = True
OvalShape4.Visible = False
RectangleShape1.Visible = False
RectangleShape2.Visible = False
RectangleShape3.Visible = False
RectangleShape4.Visible = False
ElseIf
ComboBox1.Text = "Lingkaran" And
ComboBox2.Text = "Biru" Then
OvalShape1.Visible = False
OvalShape2.Visible = False
OvalShape3.Visible = False
OvalShape4.Visible = True
RectangleShape1.Visible = False
RectangleShape2.Visible = False
RectangleShape3.Visible = False
RectangleShape4.Visible = False
ElseIf
ComboBox1.Text = "Persegi" And
ComboBox2.Text = "Merah" Then
RectangleShape1.Visible = True
RectangleShape2.Visible = False
RectangleShape3.Visible = False
RectangleShape4.Visible = False
ElseIf
ComboBox1.Text = "Persegi" And
ComboBox2.Text = "Kuning" Then
RectangleShape1.Visible = False
RectangleShape2.Visible = True
RectangleShape3.Visible = False
RectangleShape4.Visible = False
ElseIf
ComboBox1.Text = "Persegi" And
ComboBox2.Text = "Hijau" Then
RectangleShape1.Visible = False
RectangleShape2.Visible = False
RectangleShape3.Visible = True
RectangleShape4.Visible = False
ElseIf
ComboBox1.Text = "Persegi" And
ComboBox2.Text = "Biru" Then
RectangleShape1.Visible = False
RectangleShape2.Visible = False
RectangleShape3.Visible = False
RectangleShape4.Visible = True
End If
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
Me.CenterToScreen()
Me.Text
= "Program Bangun 2 Dimensi"
End Sub
End Class