visual basic

A.PROGRAM 1 ( Satu )

Private Sub command2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Command2.SetFocus

End If

End Sub

 

Private Sub Cmdok_Click()

Txt1.Text = “”

Txt2.Text = “”

Txt3.Text = “”

End Sub

 

Private Sub txt1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txt2.SetFocus

End If

End Sub

 

Private Sub txt2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txt3.SetFocus

End If

End Sub

  1. PROGRAM 2 ( SATU )

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdok_Click()

Txtnama.Text = “”

TxtTtl.Text = “”

Txtalamat.Text = “”

Txtfakultas.Text = “”

Txthobby.Text = “”

End Sub

 

Private Sub Form_Activate()

Txtnama.SetFocus

End Sub

 

Private Sub TxtNama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtTtl.SetFocus

End If

End Sub

 

Private Sub TxtTtl_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtAlamat.SetFocus

End If

End Sub

 

Private Sub TxtAlamat_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtFakultas.SetFocus

End If

End Sub

 

Private Sub TxtFakultas_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtHooby.SetFocus

End If

End Sub

        Private Sub Form_Load()

Combo1.AddItem “11100009”

Combo1.AddItem “11201011”

Combo1.AddItem “11301027”

End Sub

 

Private Sub Combo1_Click()

Dim nam, jurusan As String

Select Case Combo1.Text

Case Is = “11301027”

nama = “PAIJO”

jurusan= “Teknik informatika'”

Case Is = “11201011”

nama = “Anjar”

jurusan = “manajemen informatika”

Case Is = “11100009”

nama = “NUR”

jurusan = “sistem informasi'”

End Select

Text1.Text = nama

Text2.Text = jurusan

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

Private Sub Command1_Click()

Dim NQ, NT, UTS, UAS As Integer

Dim NA As Variant

Dim HF As String

NQ = Val(Text3.Text)

NT = Val(Text4.Text)

UTS = Val(Text5.Text)

UAS = Val(Text6.Text)

NA = (NQ+NT+UTS+UAS) / 4

Text7.Text = NA

Text7.SetFocus

Select Case Text7.Text

Case Is > 80

HF = “A”

Case Is > 70

HF = “B”

Case Is > 60

HF = “C”

Case Is > 50

HF = “D”

Case Is < 50

HF = “E”

End Select

Text8.Text = HF

Command2.SetFocus

End Sub

Private Sub Command2_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Text8.Text = “”

Combo1.Text = “”

End Sub

 

Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text5.SetFocus

End If

End Sub

 

Private Sub Text5_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text6.SetFocus

End If

End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text4.SetFocus

End If

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Command1.SetFocus

End If

End Sub

HURUF MUTU MAHASISWA STMIK PRINGSEWU

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PENGHITUNGAN GAJI KARYAWAN

 

 

 

Private Sub Form_Load()

Combo1.AddItem “I”

Combo1.AddItem “II”

Combo1.AddItem “III”

Combo1.AddItem “IV”

End Sub

 

Private Sub Cbogolongan_Click()

Dim gapok, pajak, tunjangan, total  As Variant

Select Case Cbogolongan.Text

Case “I”

gapok = 1500000

tunjangan=150000

Case “II”

gapok = 2000000

tunjangan=200000

Case “III”

gapok = 2500000

tunjangan=250000

Case “IV”

gapok = 3000000

tunjangan=300000

Case Else

gapok = 0

tunjangan  = 0

End Select

Total=gapok+tunjangan

Pajak=total*0.1

Text3.Text = gapok

Text4.Text = tunjangan

Text5.Text = pajak

Text6.Text = totL-pajak

End Sub

 

Private Sub Command1_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Combo1.Text = “”

End Sub

 

Private Sub Command2_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Combo1.Text = “”

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Text2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Combo1.SetFocus

End If

End Sub

 

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

 

 

 

 

PENGHITUNGAN GAJI PEGAWAI

 

Private Sub Command1_Click()

Dim gapok, tuj, pot As Integer

Dim gator As Long

Dim pjk, gaji diterima As Currency

Gapok = Text1.Text

Tuj  = Text2.Text

Pot  = Text3.Text

Gator   = (a + b) – c

Text4.Text = gator

pjk =  0.1 * gator

Text5.Text = pjk

Text5.SetFocus

 Gaji diterima =  gator – pjk

Text6.Text = gaji diterima

End Sub

 

Private Sub Command2_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s