Situs Dosen STKIP Siliwangi Bandung - Martin Bernard, S.Pd., M.Pd

Artikel Umum

Membuat Volume Kubus yang Interaktif

Dipublikasikan pada : 29 April 2016. Kategori : .

Untuk Tombol CommandButton “Laksanakan”

Private Sub CommandButton1_Click()
Dim a, b As Integer
a = Val(TextBox1.Text)
ActivePresentation.Slides(2).Shapes(“kubus”).TextFrame.TextRange.Text = ” Volume Kubus = ” & a * a * a
ActivePresentation.Slides(2).Shapes(“kubus”).Width = a * 50
ActivePresentation.Slides(2).Shapes(“kubus”).Height = a * 50
ActivePresentation.Slides(2).Shapes(“sisi1”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi2”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi3”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi1”).TextFrame.TextRange.Text = a
ActivePresentation.Slides(2).Shapes(“sisi2”).TextFrame.TextRange.Text = a
ActivePresentation.Slides(2).Shapes(“sisi3”).TextFrame.TextRange.Text = a
ActivePresentation.Slides(2).Shapes(“volume”).TextFrame.TextRange.Text = “”
End Sub

Untuk tombol yang dari Insert

Sub putar()
ActivePresentation.Slides(2).Shapes(“kubus”).Rotation = ActivePresentation.Slides(2).Shapes(“kubus”).Rotation + 5
End Sub
Sub kanan()
ActivePresentation.Slides(2).Shapes(“kubus”).Left = ActivePresentation.Slides(2).Shapes(“kubus”).Left – 5
ActivePresentation.Slides(2).Shapes(“sisi1”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi2”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi3”).Visible = False
End Sub
Sub kiri()
ActivePresentation.Slides(2).Shapes(“kubus”).Left = ActivePresentation.Slides(2).Shapes(“kubus”).Left + 5
ActivePresentation.Slides(2).Shapes(“sisi1”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi2”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi3”).Visible = False
End Sub
Sub atas()
ActivePresentation.Slides(2).Shapes(“kubus”).Top = ActivePresentation.Slides(2).Shapes(“kubus”).Top – 5
ActivePresentation.Slides(2).Shapes(“sisi1”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi2”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi3”).Visible = False
End Sub
Sub bawah()
ActivePresentation.Slides(2).Shapes(“kubus”).Top = ActivePresentation.Slides(2).Shapes(“kubus”).Top + 5
ActivePresentation.Slides(2).Shapes(“sisi1”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi2”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi3”).Visible = False
End Sub
Sub balik()
ActivePresentation.Slides(2).Shapes(“kubus”).Rotation = ActivePresentation.Slides(2).Shapes(“kubus”).Rotation – 5
ActivePresentation.Slides(2).Shapes(“sisi1”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi2”).Visible = False
ActivePresentation.Slides(2).Shapes(“sisi3”).Visible = False
End Sub

Bisa dilihat di sini