Selamat Menikmati Blog Ini, Semoga Bermanfaat Selamat Menikmati Blog Ini, Semoga Bermanfaat Blog Yang Penuh Inspiratif Blog Yang Penuh Inofatif Blog Yang Penuh Inspiratif Selamat Menikmati Blog Ini, Semoga Bermanfaat DAN Jika Ada Kesalahan Mohon Dimaafkan

Selasa, 11 Agustus 2015

Microsoft Visual Basic

Hasil karya saya di Microsoft Visual Basic. di SMK Taruna Jaya Prawira Tuban.

Bisa Download dalam bentuk Microsoft Word DI SINI

  1.  Percobaan BIODATA1  Microsoft Visual Basic





    2.   Percobaan BIODATA2 Microsoft Visual Basic





3. Percobaan KALKULATOR1 Microsoft Visual Basic


Inilah Code nya
Calculator1

Private Sub Text2_Change()
End Sub
__________________________________________________________
Private Sub cmdOK_Click()
txtPesan.Text = "selamat datang " & txtNama.Text & " Di Lab RPL "
End Sub
__________________________________________________________
Private Sub cmdsamadengan1_Click()
lblH1.Caption = Val(Txt1.Text) + Val(Txt2.Text)
End Sub
__________________________________________________________
Private Sub cmdsamadengan2_Click()
LblH2.Caption = Val(Txt3.Text) - Val(Txt4.Text)
End Sub
__________________________________________________________
Private Sub cmdsamadengan3_Click()
LblH3.Caption = Val(Txt5.Text) * Val(Txt6.Text)
End Sub
__________________________________________________________
Private Sub cmdsamadengan4_Click()
lblH4.Caption = Val(Txt7.Text) / Val(Txt8.Text)
End Sub
__________________________________________________________
Private Sub cmdSamaDengan5_Click()
lblH5.Caption = Val(Txt9.Text) ^ Val(Txt10.Text)
End Sub




4. Percobaan KALKULATOR2 Microsoft Visual Basic


Inilah Code nya
Calculator2
Dim A As Double
Dim B As Double
Dim O As String
Dim H As Double
__________________________________________________________
Private Sub cmd0_Click()
txtDisplay.Text = txtDisplay.Text & "0"
End Sub
__________________________________________________________
Private Sub cmd1_Click()
txtDisplay.Text = txtDisplay.Text & "1"
End Sub
__________________________________________________________
Private Sub cmd2_Click()
txtDisplay.Text = txtDisplay.Text & "2"
End Sub
__________________________________________________________
Private Sub cmd3_Click()
txtDisplay.Text = txtDisplay.Text & "3"
End Sub
__________________________________________________________
Private Sub cmd4_Click()
txtDisplay.Text = txtDisplay.Text & "4"
End Sub
__________________________________________________________
Private Sub cmd5_Click()
txtDisplay.Text = txtDisplay.Text & "5"
End Sub
__________________________________________________________
Private Sub cmd6_Click()
txtDisplay.Text = txtDisplay.Text & "6"
End Sub
__________________________________________________________
Private Sub cmd7_Click()
txtDisplay.Text = txtDisplay.Text & "7"
End Sub
__________________________________________________________
Private Sub cmd8_Click()
txtDisplay.Text = txtDisplay.Text & "8"
End Sub
__________________________________________________________
Private Sub cmd9_Click()
txtDisplay.Text = txtDisplay.Text & "9"
End Sub
__________________________________________________________
Private Sub cmdAC_Click()
txtDisplay.Text = ""
End Sub
__________________________________________________________
Private Sub cmdBAGI_Click()
A = Val(txtDisplay.Text)
O = "/"
txtDisplay.Text = ""
End Sub
__________________________________________________________
Private Sub cmdKALI_Click()
A = Val(txtDisplay.Text)
O = "*"
txtDisplay.Text = ""
End Sub
__________________________________________________________
Private Sub cmdKOMA_Click()
txtDisplay.Text = txtDisplay.Text & "."
End Sub
__________________________________________________________
Private Sub cmdKURANG_Click()
A = Val(txtDisplay.Text)
O = "-"
txtDisplay.Text = ""
End Sub
__________________________________________________________
Private Sub cmdSD_Click()
B = Val(txtDisplay.Text)
Select Case O
    Case "+": txtDisplay.Text = A + B
    Case "-": txtDisplay.Text = A - B
    Case "*": txtDisplay.Text = A * B
    Case "/": txtDisplay.Text = A / B
End Select
__________________________________________________________
A = 0
B = 0
End Sub
__________________________________________________________
Private Sub cmdTAMBAH_Click()
A = Val(txtDisplay.Text)
O = "+"
txtDisplay.Text = ""
End Sub




5. Hitungan bangun datar persegi dan segitiga


Inilah Codenya

Hitungan persegi dan segitiga

Private Sub cmdSD1_Click()
lbLH1.Caption = Val(txt1.Text) * Val(txt2.Text)
lbLH2.Caption = 2 * (Val(txt1.Text) + Val(txt2.Text))
End Sub
__________________________________________________________
Private Sub cmdSD2_Click()
lbLH3.Caption = Val(txt3.Text) * Val(txt4.Text)
lbLH4.Caption = 1 / 2 * Val(txt3.Text) * Val(txt4.Text)
End Sub
__________________________________________________________
Private Sub txt1_Change()
txt1.Text = txt1.Text & ""
End Sub
__________________________________________________________
Private Sub txt2_Change()
txt2.Text = txt2.Text & ""
End Sub
__________________________________________________________
Private Sub txt3_Change()
txt3.Text = txt3.Text & ""
End Sub
__________________________________________________________
Private Sub txt4_Change()
txt4.Text = txt4.Text & ""
End Sub





6. Hitungan 1-10 dengan Timer


Inilah Codenya

Hitungan

Private Sub Command1_Click()
If Command1.Caption = "START" Then
Command1.Caption = "STOP"
____________________________________________
Timer1.Enabled = True
End If
End Sub
____________________________________________
Private Sub Image3_Click()
End Sub
_____________________________________________
Private Sub Label1_Click()
Else
Command1.Caption = "STOP"
Label1.Caption = 0 - 11
Timer1.Enabled = False
End If
End Sub
End Sub
_____________________________________________
Private Sub Timer1_Timer()
If Label1.Caption = 0 Then
Label1.Caption = 1
ElseIf Label1.Caption = 1 Then
Label1.Caption = 2
ElseIf Label1.Caption = 2 Then
Label1.Caption = 3
ElseIf Label1.Caption = 3 Then
Label1.Caption = 4
ElseIf Label1.Caption = 4 Then
Label1.Caption = 5
ElseIf Label1.Caption = 5 Then
Label1.Caption = 6
ElseIf Label1.Caption = 6 Then
Label1.Caption = 7
ElseIf Label1.Caption = 7 Then
Label1.Caption = 8
ElseIf Label1.Caption = 8 Then
Label1.Caption = 9
ElseIf Label1.Caption = 9 Then
Label1.Caption = 10
ElseIf Label1.Caption = 10 Then
MsgBox "selamat jalan kawan"
End If
End Sub
_________________________________________
Private Sub Form_Load()
Command1.Caption = "START"
Label1.Caption = 0
Timer1.Interval = 1000
Timer1.Enabled = False

End Sub





7. NOTEPAD dengan microsoft visual basic


Inilah Codenya

Notepat visual basic

Private Sub Form_Resize()
Text1.Width = Form1.ScaleWidth
Text1.Height = Form1.ScaleHeight
End Sub
__________________________________________________________
Private Sub mnAboutNotepad_Click()
Form2.Show
End Sub
__________________________________________________________
Private Sub mnExit_Click()
End
End Sub
__________________________________________________________
Private Sub mnFont_Click()
CommonDialog1.ShowFont
End Sub
__________________________________________________________
Private Sub mnNew_Click()
Text1.Text = ""
End Sub
__________________________________________________________
Private Sub mnOpen_Click()
CommonDialog1.ShowOpen
End Sub
__________________________________________________________
Private Sub mnPrint_Click()
CommonDialog1.ShowPrinter
End Sub
__________________________________________________________
Private Sub mnSaveAs_Click()
CommonDialog1.ShowSave
End Sub
__________________________________________________________
Private Sub mnWordWarp_Click()
mnWordWarp.Checked = Not (mnWordWarp.Checked)
End Sub
__________________________________________________________
Private Sub Text1_Change()
mnUndo.Enabled = True
End Sub