Anda di halaman 1dari 3

Lilia Amarwani

13.02.8494
D3 Manajemen Informatika

Program Faktorial
Langkah membuat bentuk form:
1. Siapkan gambar vektor yang berekstensi .png
2. Eksport lewat Corel Draw ke file berekstensi .BMP
3. Masukkan gambar tersebut ke VB Shaped Form Creator lalu seleksi, dan
simpan dalam file berekstensi .frm
4. Buka file tersebut di Microsoft Visual Basic 6.0
5. Form siap diisi
Langkah membuat program faktorial:
1. Atur propertinya:
Object
Form
Label1
Label2
Label3
Label4
Text1
Text2
Command1
Command2
Command3

Property
Name
Caption
Caption
Caption
Caption
Caption
Caption
Caption
Caption
Caption
Caption

2. Listing Program:
a. Object Command1, Event Click
Private Sub Command1_Click()
Dim x, y, z As Integer
z=1
y = Text1.Text

Nilai
Faktorial
Faktorial
Program Faktorial._^
Masukkan angka faktorial
Hasil Faktorial
By: Lilia (13.02.8494)
Kosongkan
Kosongkan
Proses
Hapus
Keluar

For x = 1 To y
z=z*x
Next
Text2.Text = z
End Sub
b. Object Command2, Event Click
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
c. Object Command3, Event Click
Private Sub Command4_Click()
Unload Me
End Sub

Anda mungkin juga menyukai