MENENTUKAN RUMUS BANGUN DATAR PERSEGI PANJANG, BALOK ,
PERSEGI, KUBUS
ASSALAMU'ALAIKUM WARAHMATULLAHI WABAROKATUH :)
SELAMAT DATANG DI BLOG SAYA, SAYA AKAN MEMPOSTING
MENGENAI PROGRAM VISUAL BASIC 10 YANG
SAYA BUAT
PROJECT LATIHAN 8
BERIKUT ADALAH CODING
MENENTUKAN RUMUS BANGUN DATAR PERSEGI PANJANG, BALOK ,
PERSEGI, KUBUS
Public Class latihan8
'deklarasi Menu Utama
'Dim pilih As Integer
'deklarasi Balok
'Dim pjbalok, lbbalok, tgbalok, vlbalok As Integer
'deklarasi Lingkaran
'Dim jari, Isilingkaran As Integer
Dim PHI = 3.14
'deklarasi Kubus
'Dim Sisi, vlkubus As Integer
'deklarasi Persegi Panjang
'Dim pjpersegi, lbpersegi,lspersegi As Integer
Sub menuutama()
Select Case (Val(Me.TxtPilih.Text))
Case 1
Me.PMenu.Visible = True
Me.PBalok.Visible
= False
Case 2
Me.PMenu.Visible = False
Me.PLingkaran.Visible = True
Case 3
Me.PMenu.Visible = False
Me.PKubus.Visible = True
Case 4
Me.PMenu.Visible = False
Me.PPersegipanjang.Visible = True
Case 5
utama.Enabled = True
utama.Show()
Me.Hide()
Case Else
Me.TxtPilih.Text
= ""
Me.TxtPilih.Focus()
End Select
End Sub
Sub menubalok()
Me.TxtVolumebalok.Text = Val(Me.TxtPanjangbalok.Text)
* Val(Me.TxtLebarbalok.Text) * Val(Me.TxtTinggibalok.Text)
End Sub
Sub
menulingkaran()
Me.Txtluaslingkaran.Text = Val(Me.Txtjari.Text) ^ 2 * PHI
End Sub
Sub menukubus()
Me.TxtVolumeKubus.Text = Val(Me.Txtsisi.Text)
^ 3
End Sub
Sub menupersegi()
Me.TxtLuaspersegi.Text = Val(Me.TextPanjangpersegi.Text)
* Val(Me.TxtLebarpersegi.Text)
End Sub
Private Sub
latihan8_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Me.PMenu.Location = New
System.Drawing.Point(12, 12)
Me.PBalok.Location = New
System.Drawing.Point(12, 12)
Me.PLingkaran.Location = New
System.Drawing.Point(12, 12)
Me.PKubus.Location = New
System.Drawing.Point(12, 12)
Me.PPersegipanjang.Location = New System.Drawing.Point(12,
12)
Me.PMenu.Visible = True
Me.PBalok.Visible = False
Me.PLingkaran.Visible = False
Me.PKubus.Visible = False
Me.PPersegipanjang.Visible = False
End Sub
Private Sub
TxtPilih_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
TxtPilih.TextChanged
Call menuutama()
End Sub
'panel balok
Private Sub
TxtPanjangbalok_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
TxtPanjangbalok.TextChanged
Call menubalok()
End Sub
Private Sub
TxtLebarbalok_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
TxtLebarbalok.TextChanged
Call menubalok()
End Sub
Private Sub
TxtTinggibalok_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
TxtTinggibalok.TextChanged
Call menubalok()
End Sub
Private Sub
lbMenu_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
lbMenu.Click
Me.PBalok.Visible = False
Me.PMenu.Visible = True
End Sub
'panel lingkaran
Private Sub
Txtjari_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Txtjari.TextChanged
Call menulingkaran()
End Sub
Private Sub
LbMenu2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
LbMenu2.Click
Me.PLingkaran.Visible = False
Me.PMenu.Visible = True
End Sub
'panel kubus
Private Sub
Txtsisi_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Txtsisi.TextChanged
Call menukubus()
End Sub
Private Sub
LbMenu3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
LbMenu3.Click
Me.PKubus.Visible = False
Me.PMenu.Visible = True
End Sub
'panel persegi
Private Sub TextPanjangpersegi_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Handles TextPanjangpersegi.TextChanged
Call menupersegi()
End Sub
Private Sub
LbMenu4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
LbMenu4.Click
Me.PPersegipanjang.Visible = False
Me.PMenu.Visible = True
End Sub
End Class
Tidak ada komentar:
Posting Komentar