Latihan 4.

Buat Design Form Sebagai berikut:

Object Form1 TextBox1 TextBox2 TextBox3 Command1 Command2 Command3 Command4 Command5

Propertis Name Caption StartUpPostion Name Text Name Text Name Text Name Text Name Caption Name Caption Name Caption Name Caption

Setting frmhitung ..::Program Keempat::.. 2 - CenterScreen txtnil1 Tulisan text1 di hapus xtnil2 Tulisan text2 di hapus txthasil Tulisan text3 di hapus cmdtambah TAMBAH cmdkurang KURANG cmdkali KALI cmdbagi BAGI cmdkeluar KELUAR

Private Sub cmdbagi_Click() txthasil.Text = Val(txtnil1.Text) / Val(txtnil2.Text) End Sub

Private Sub cmdkali_Click() txthasil.Text = Val(txtnil1.Text) * Val(txtnil2.Text) End Sub Private Sub cmdkeluar_Click() End End Sub Private Sub cmdkurang_Click() txthasil.Text = Val(txtnil1.Text) - Val(txtnil2.Text) End Sub Private Sub cmdtambah_Click() txthasil.Text = Val(txtnil1.Text) + Val(txtnil2.Text) End Sub
Latihan 5. Buat Design Form Sebagai berikut:

Object Form1 TextBox1

Propertis Name Caption StartUpPostion Name

Setting frmnilai ..::Program Kelima::.. 2 - CenterScreen txtnim

TextBox2 TextBox3 TextBox4 TextBox5

Text Name Text Name Text Name Text Name Text Name Text Name Text Name Text Name Text Name Caption Name Caption

Tulisan text1 txtnama Tulisan text2 txtkelas Tulisan text3 txtabsen Tulisan text3 txttugas Tulisan text3

di hapus di hapus di hapus di hapus di hapus

TextBox6 TextBox7 TextBox8 Command1 Command2 Command3

txtuts Tulisan text3 di hapus txtuas Tulisan text3 di hapus txtrata Tulisan text3 di hapus cmdhitung HITUNG cmdbersih BERSIH cmdkeluar KELUAR

Private Sub cmdbersih_Click() txtnim.Text = "" txtnama.Text = "" txtkelas.Text = "" txtabsen.Text = "" txttugas.Text = "" txtuts.Text = "" txtuas.Text = "" txtrata.Text = "" txtnim.SetFocus End Sub Private Sub cmdhitung_Click() txtrata = Val((10 / 100 * txtabsen.Text) + (20 / 100 * txttugas.Text) + (30 / 100 * txtuts.Text) + (40 / 100 * txtuas.Text)) End Sub Private Sub cmdkeluar_Click() End

End Sub Private Sub txtnama_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtkelas.SetFocus End If End Sub Private Sub txtkelas_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtabsen.SetFocus End If End Sub Private Sub txtabsen_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txttugas.SetFocus End If End Sub Private Sub txttugas_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtuts.SetFocus End If End Sub Private Sub txtuts_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtuas.SetFocus End If End Sub Private Sub txtnim_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtnama.SetFocus End If End Sub

Sign up to vote on this title
UsefulNot useful