Pages

Ads 468x60px

Rabu, 07 November 2012

Rumus Visual Basic


 
RUMUS  OK
Private Sub Command1_Click()
Label2.Caption = Text1.Text
End Sub

RUMUS  KELUAR
Private Sub Command2_Click()
End
End Sub

RUMUS  TEXT 1
Private Sub Text1_Change()
Label2.Caption = Label2.Caption
End Sub

RUMUS  HURUF MIRING
Private Sub Check1_Click()
Label2.FontItalic = Check1.Value
End Sub

RUMUS  HURUF TEBAL
Private Sub Check2_Click()
Label2.FontBold = Check1.Value
End Sub



RUMUS  WARNA MERAH
Private Sub Option1_Click()
Label2.ForeColor = vbRed
End Sub

RUMUS  WARNA BIRU
Private Sub Option2_Click()
Label2.ForeColor = vbBlue
End Sub

RUMUS  NILAI RATA - RATA
Private Sub Command1_Click()
Text4.Text = (Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)) / 3
End Sub

RUMUS  KELUAR
Private Sub Command2_Click()
End
End Sub

RUMUS  ENTER
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
RUMUS  HAPUS
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus
End Sub

RUMUS  KELUAR PERINGATAN
Private Sub Command3_Click()
PESAN = MsgBox("YAKIN AKAN KELUAR ??", vbYesNo, "PERINGATAN")
If PESAN = vbYes Then
Unload Me
End If
End Sub

RUMUS COMBO
Private Sub Combo4_Click()
If Combo4.Text = "MI" Then
Text1.Text = "MANAJEMAN INFORMATIKA"
Text2.Text = 250000
ElseIf Combo4.Text = "KA" Then
Text1.Text = "KOMPUTER AKUNTANSI"
Text2.Text = 250000
ElseIf Combo4.Text = "SI" Then
Text1.Text = "SISTEM INFORMASI"
Text2.Text = 300000
End If
End Sub

















 RUMUS  DAFTAR COMBO
TANGGAL
Private Sub Form_Load()
For A = 0 To 30
Combo1.List(A) = A + 1
Next A
BULAN
For B = 1 To 12
Combo2.AddItem MonthName(B)
Next B
TAHUN
For C = 0 To 10
Combo3.List(C) = C + 2012
Next C
JURUSAN
Combo4.AddItem "MI"
Combo4.AddItem "KA"
Combo4.AddItem "SI"
End Sub

RUMUS JUMLAH (X)
Private Sub Combo1_Click()
Text5.Text = (Val(Text4.Text) * Val(Combo1.Text))
End Sub





ENTER + TEXT
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "MLT" Then
Text2.Text = "Melati"
Text3.Text = "AC"
Text4.Text = "250000"
ElseIf Text1.Text = "MWR" Then
Text2.Text = "Mawar"
Text3.Text = "Kipas Angin"
Text4.Text = "300000"
End If
Combo1.SetFocus
End If
End Sub

ENTER + POTONGAN
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.Text = (Val(Text5.Text) - Val(Text6.Text))
Text7.SetFocus
End If
End Sub

1 komentar:

 

Sample text

Sample Text

Sample Text