Sie sind auf Seite 1von 4

Dim nVal1, nVal2 As Double

Dim nResult As Double


Dim sOperator As String
Private Sub Command1_Click()
Text1.Text = Text1.Text & 7
End Sub
Private Sub Command10_Click()
sOperator = "/"
nVal1 = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Command11_Click()
Text1.Text = Text1.Text & 1
End Sub
Private Sub Command12_Click()
Text1.Text = Text1.Text & 2
End Sub
Private Sub Command13_Click()
Text1.Text = Text1.Text & 3
End Sub
Private Sub Command14_Click()
sOperator = "+"
nVal1 = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Command15_Click()
sOperator = "-"
nVal1 = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Command16_Click()
If Text1.Text <> "0" And Text1.Text <> "" Then
Text1.Text = Text1.Text & 0
End If
End Sub

Private Sub Command17_Click()


If Text1.Text = "" Then
Text1.Text = Text1.Text & "0,"
Else
Text1.Text = Text1.Text & "."
End If
End Sub
Private Sub Command18_Click()
Dim nTem As Double
nTem = Val(Text1.Text)
Select Case sOperator
Case "+"
nResult = nVal1 + nTem
Case "-"
nResult = nVal1 - nTem
Case "*"
nResult = nVal1 * nTem
Case "/"
If nTem <> 0 Then
nResult = nVal1 / nTem
Else
Text1.Text = " Khng th chia cho khng"
Exit Sub
End If
End Select
If sOperator <> "" Then
Text1.Text = Str(nResult)
sOperator = ""
End If
End Sub
Private Sub Command19_Click()
Dim p As String
p = Shell("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.exe")
End Sub
Private Sub Command2_Click()
Text1.Text = Text1.Text + "8"
End Sub
Private Sub Command20_Click()
Dim p As String
p = Shell("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe")
End Sub

Private Sub Command3_Click()


Text1.Text = Text1.Text & 9
End Sub
Private Sub Command4_Click()
Text1.Text = ""
End Sub
Private Sub Command5_Click()
sOperator = ""
nVal1 = 0
Text1.Text = ""
End Sub
Private Sub Command6_Click()
Text1.Text = Text1.Text & 4
End Sub
Private Sub Command7_Click()
Text1.Text = Text1.Text & 5
End Sub
Private Sub Command8_Click()
Text1.Text = Text1.Text & 6
End Sub
Private Sub Command9_Click()
sOperator = "*"
nVal1 = Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub mnua_Click()
Dim p As String
p = Shell("C:\Program Files\AutoCAD 2004\acad.exe")
End Sub
Private Sub mnue_Click()
Dim p As String
p = Shell("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe")
End Sub
Private Sub mnuf_Click()
Dim p As String
p = Shell("C:\Program Files\Mozilla Firefox\firefox.exe")

End Sub
Private Sub mnuhe_Click()
Dim p As String
p = Shell("C:\Program Files\Heroes 3 Shadow Of Death - Wake Of
God\Heroes3SOD.exe")
End Sub
Private Sub mnuhp_Click()
MsgBox " Phan men ung dung"
End Sub
Private Sub mnumr_Click()
Dim p As String
p = Shell("C:\Program Files\Mobipocket.com\Mobipocket Reader\reader.exe")
End Sub
Private Sub mnuthoat_Click()
End
End Sub
Private Sub mnuv_Click()
Dim p As String
p = Shell("C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe")
End Sub
Private Sub mnuWD_Click()
Dim p As String
p = Shell("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.exe")
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = vbBack Then Exit Sub
If Not Chr(KeyAscii) Like "[0-9,-]" Then
KeyAscii = 0
MsgBox " Ban hay nhap so", vbInformation, " Nhap lai"
End If
End Sub

Das könnte Ihnen auch gefallen