Ok First Search kayo nito if wala pa kayo then Install nyo.. ==> spchapi.exe then pag na install mo na..
Open mo ang VB6 Then Creat an new Project ka... then Import mo sa Reference ang Microsoft Speech
Object Library then pag Ok na sa Form na tayo..
1. First put 1 Button. the first button name is Digit. then set the index property of 1
then Copy and Past until Index 9.
2. You Need 7 Button for Clear, Point, Minus, Plus, Times, Divide and Equal
3. Put 1 Label and the label name is Display
Now lets Start for the Code
Copy and Paste this Code to the Form
- Code:
-
Option Explicit
Dim Voice As SpVoice
Dim Operand1 As Double, Operand2 As Double
Dim Operator As String
Dim ClearDisplay As Boolean
Private Sub Add_Click()
Operand1 = Val(Display.Caption)
Operator = "+"
Display.Caption = ""
Voice.Speak "Plus", SVSFlagsAsync
End Sub
Private Sub Clear_Click()
Display.Caption = ""
Voice.Speak "Clear", SVSFlagsAsync
End Sub
Private Sub Digits_Click(Index As Integer)
If ClearDisplay Then
Display.Caption = ""
ClearDisplay = False
End If
Display.Caption = Display.Caption + Digits(Index).Caption
Voice.Speak Digits(Index).Caption, SVSFlagsAsync
End Sub
Private Sub Divide_Click()
Operand1 = Val(Display.Caption)
Operator = "/"
Display.Caption = ""
Voice.Speak "Divide", SVSFlagsAsync
End Sub
Private Sub Equals_to_Click()
Dim Result As Double
Operand2 = Val(Display.Caption)
If Operator = "+" Then Result = Operand1 + Operand2
If Operator = "-" Then Result = Operand1 - Operand2
If Operator = "*" Then Result = Operand1 * Operand2
If Operator = "/" And Operand2 <> "0" Then Result = Operand1 / Operand2
Display.Caption = Result
Voice.Speak "Equals" & Display.Caption, SVSFlagsAsync
End Sub
Private Sub Form_Load()
Set Voice = New SpVoice
End Sub
Private Sub MenuCalculatorAuthor_Click()
MsgBox ("Created By: EL^Diablo`GUNmaster of Pinoy Xtreme")
End Sub
Private Sub MenuCalculatorExit_Click()
End
End Sub
Private Sub Multiply_Click()
Operand1 = Val(Display.Caption)
Operator = "*"
Display.Caption = ""
Voice.Speak "Times", SVSFlagsAsync
End Sub
Private Sub Point_Click()
If InStr(Display.Caption, ".") Then
Exit Sub
Else
Display.Caption = Display.Caption + "."
Voice.Speak "Dot", SVSFlagsAsync
End If
End Sub
Private Sub Subtract_Click()
Operand1 = Val(Display.Caption)
Operator = "-"
Display.Caption = ""
Voice.Speak "Minus", SVSFlagsAsync
End Sub