Minggu, 13 Februari 2011
Jumat, 11 Februari 2011
Pertama kita buat 9 label,2 textbox,dan 4 commandbuttom dan kemudian kita ubah nama-nama pada toolbox tersebut seperti dibawah ini:
· Label1ganti denganGaji tukang
· Label2ganti dengangaji
· Label3ganti dengankelebihan jam
· Label4ganti denganbonus gaji
· Label5ganti denganhadiah
· Label6ganti dengantotal gaji
· Label7,8,9 kita hapus namanya di caption
· Command1ganti denganproses
· Command2ganti denganclear
· Command3vaktif
· Command4ganti dengankeluar
Kemudian kita mulai pengkodean seperti dibawah ini:
Private Sub Command1_Click()
Label7.Caption = Val(Text2.Text) * 30000
Label8.Caption = Val(Text1.Text) * 10 / 100
Label9.Caption = Val(Label7.Caption) + Val(Label8.Caption) + Val(Text1.Text)
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Label7.Caption = ""
Label8.Caption = ""
Label9.Caption = ""
End Sub
Private Sub Command3_Click()
Text1.Enabled = 1
Text2.Enabled = 1
Label7.Enabled = 1
Label8.Enabled = 1
Label9.Enabled = 1
Command1.Enabled = 1
Command2.Enabled = 1
Command4.Enabled = 1
MsgBox "Aplikasi Aktif..Selamat Menghitung"
End Sub
Private Sub Command4_Click()
MsgBox "Exit"
End
End Sub
Private Sub Form_Load()
Text1.Enabled = 0
Text2.Enabled = 0
Label7.Enabled = 0
Label8.Enabled = 0
Label9.Enabled = 0
Command1.Enabled = 0
Command2.Enabled = 0
Command4.Enabled = 0
End Sub
Selamat bekerja
Langganan:
Postingan (Atom)