- Back to Home »
- Cara Membuat Program Menghitung Luas Keliling Volume Bangun Dengan Visual Basic 6
Posted by : Bima Hardi Anto
Kamis, 14 November 2013
Siang agan agan semua. Saya mau share dikit nih. langsung aja cekibrottt...
Cara pertama buat tampilan VB seperti ini
Copas Source Code ini
Dim a, b, d As Single
Private Sub Command1_Click()
If Option1.Value = True Then
a = Text1.Text
b = Text2.Text
d = a ^ 2
Text4.Text = d
Else
If Option2.Value = True Then
a = Text1.Text
b = Text2.Text
d = a * b
Text4.Text = d
Else
If Option3.Value = True Then
a = Text1.Text
b = Text2.Text
d = (a * b) / 2
Text4.Text = d
Else
If Option4.Value = True Then
a = Text1.Text
b = Text2.Text
d = a * b
Text4.Text = d
Else
If Option5.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = (0.5 * (a + b)) * c
Text4.Text = d
Else
If Option6.Value = True Then
a = Text1.Text
b = Text2.Text
d = (a * b) / 2
Text4.Text = d
Else
If Option7.Value = True Then
a = Text1.Text
b = Text2.Text
d = (a * b) / 2
Text4.Text = d
Else
If Option8.Value = True Then
a = Text1.Text
b = Text2.Text
d = 22 / 7 * a ^ 2
Text4.Text = d
Else
If Option23.Value = True Then
a = Text1.Text
hasil = 4 * a
Text4.Text = hasil
Else
If Option22.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
hasil = 2 * (a + b)
Text4.Text = hasil
Else
If Option21.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
hasil = (a + b + c)
Text4.Text = hasil
Else
If Option20.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text5.Text)
hasil = (a + b + c + d)
Text4.Text = hasil
Else
If Option19.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text5.Text)
hasil = (a + b + c + d)
Text4.Text = hasil
Else
If Option18.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text5.Text)
hasil = (a + b + c + d)
Text4.Text = hasil
Else
If Option17.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text5.Text)
hasil = (a + b + c + d)
Text4.Text = hasil
Else
If Option16.Value = True Then
a = Text1.Text
hasil = 2 * 22 / 7 * a
Text4.Text = hasil
Else
If Option9.Value = True Then
a = Text1.Text
hasil = a ^ 3
Text4.Text = hasil
Else
If Option10.Value = True Then
a = Text1.Text
b = Text2.Text
c = Text3.Text
hasil = a * b * c
Text4.Text = hasil
Else
If Option11.Value = True Then
a = Text1.Text
b = Text2.Text
hasil = a * b
Text4.Text = hasil
Else
If Option12.Value = True Then
a = Text1.Text
b = Text2.Text
hasil = 1 / 3 * a * b
Text4.Text = hasil
Else
If Option13.Value = True Then
a = Text1.Text
b = Text2.Text
hasil = 1 / 3 * a * b
Text4.Text = hasil
Else
If Option14.Value = True Then
a = Text1.Text
b = Text2.Text
hasil = 22 / 7 * a ^ 2 * b
Text4.Text = hasil
Else
If Option15.Value = True Then
a = Text1.Text
hasil = 4 / 3 * 22 / 7 * a ^ 3
Text4.Text = hasil
Else
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
MsgBox ("SUWUN BOSS")
End
End Sub
Private Sub Form_Load()
Label1.Caption = "Sisi"
Label2.Visible = False
Text1.Visible = True
Text2.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option1_Click()
Label1.Caption = "Sisi"
Label2.Visible = False
Label3.Visible = False
Text2.Visible = False
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option10_Click()
Label1.Caption = "Panjang"
Label2.Caption = "Lebar"
Label3.Caption = "Tinggi"
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Text1.Visible = True
Text2.Visible = True
Text3.Visible = True
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option11_Click()
Label1.Caption = "Luas Alas"
Label2.Caption = "Tinggi"
Label1.Visible = True
Label2.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = False
Label5.Visible = False
Text3.Visible = False
Label3.Visible = False
End Sub
Private Sub Option12_Click()
Label1.Caption = "Luas Alas"
Label2.Caption = "Tinggi"
Label1.Visible = True
Label2.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = False
Label5.Visible = False
Text3.Visible = False
Label3.Visible = False
End Sub
Private Sub Option13_Click()
Label1.Caption = "Luas Alas"
Label2.Caption = "Tinggi"
Label1.Visible = True
Label2.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = False
Label5.Visible = False
Text3.Visible = False
Label3.Visible = False
End Sub
Private Sub Option14_Click()
Label1.Caption = "Jari-Jari"
Label2.Caption = "Tinggi"
Label1.Visible = True
Label2.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = False
Label5.Visible = False
Text3.Visible = False
Label3.Visible = False
End Sub
Private Sub Option15_Click()
Label1.Caption = "Jari-Jari"
Label1.Visible = True
Label2.Visible = False
Label3.Visible = False
Label5.Visible = False
Text1.Visible = True
Text2.Visible = False
Text3.Visible = False
Text5.Visible = False
End Sub
Private Sub Option16_Click()
Label1.Caption = "Jari-Jari"
Label1.Visible = True
Label2.Visible = False
Label3.Visible = False
Label5.Visible = False
Text1.Visible = True
Text2.Visible = False
Text3.Visible = False
Text5.Visible = False
End Sub
Private Sub Option17_Click()
Label1.Caption = "Sisi A"
Label2.Caption = "sisi B"
Label3.Caption = "sisi C"
Label5.Caption = "sisi D"
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label5.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = True
End Sub
Private Sub Option18_Click()
Label1.Caption = "Sisi A"
Label2.Caption = "sisi B"
Label3.Caption = "sisi C"
Label5.Caption = "sisi D"
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label5.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = True
End Sub
Private Sub Option19_Click()
Label1.Caption = "Sisi A"
Label2.Caption = "sisi B"
Label3.Caption = "sisi C"
Label5.Caption = "sisi D"
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label5.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = True
End Sub
Private Sub Option2_Click()
Label1.Caption = "Panjang"
Label2.Caption = "Lebar"
Label2.Visible = True
Label3.Visible = False
Text2.Visible = True
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option20_Click()
Label1.Caption = "Sisi A"
Label2.Caption = "sisi B"
Label3.Caption = "sisi C"
Label5.Caption = "sisi D"
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label5.Visible = True
Text1.Visible = True
Text2.Visible = True
Text5.Visible = True
End Sub
Private Sub Option21_Click()
Label1.Caption = "Sisi A"
Label2.Caption = "sisi B"
Label3.Caption = "sisi C"
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Text1.Visible = True
Text2.Visible = True
Text3.Visible = True
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option22_Click()
Label1.Caption = "Panjang"
Label2.Caption = "Lebar"
Label1.Visible = True
Label2.Visible = True
Label3.Visible = False
Text1.Visible = True
Text2.Visible = True
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option23_Click()
Label1.Caption = "Sisi"
Label2.Visible = False
Label3.Visible = False
Text1.Visible = True
Text2.Visible = False
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option3_Click()
Label1.Caption = "Alas"
Label2.Caption = "Tinggi"
Label2.Visible = True
Label3.Visible = False
Text2.Visible = True
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option4_Click()
Label1.Caption = "Alas"
Label2.Caption = "Tinggi"
Label2.Visible = True
Label3.Visible = False
Text2.Visible = True
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option5_Click()
Label1.Caption = "AB"
Label2.Caption = "CD"
Label3.Caption = "Tinggi"
Label2.Visible = True
Label3.Visible = True
Text2.Visible = True
Text3.Visible = True
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option6_Click()
Label1.Caption = "D1"
Label2.Caption = "D2"
Label2.Visible = True
Label3.Visible = False
Text2.Visible = True
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option7_Click()
Label1.Caption = "Diagonal 1"
Label2.Caption = "Diagonal 2"
Label2.Visible = True
Label3.Visible = False
Text2.Visible = True
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option8_Click()
Label1.Caption = "Jari-jari"
Label2.Visible = False
Label3.Visible = False
Text2.Visible = False
Text3.Visible = False
Text5.Visible = False
Label5.Visible = False
End Sub
Private Sub Option9_Click()
Label1.Caption = "Sisi"
Label2.Visible = False
Label3.Visible = False
Label5.Visible = False
Text1.Visible = True
Text2.Visible = False
Text3.Visible = False
Text5.Visible = False
End Sub
klu udah langsung play aja gan, semoga berhasil :)