VisualBasic6.0
Hai,
I have created one calculator program in Visual Basic 6.0.I have one doubt in this.please help me
My calculator program is working,but i want to add more in this.(i.e.,)
I'll explain what i did?
I have created binary array for operators(+,-,*,/) and create another array for numbers(0-9)
Herewith i have attached my program...pls check it out ..and clarify my doubts..
__________________________________________________ __________________________________
Option Explicit
Dim pv As Single
Dim a As Integer
Dim op As String
Dim m As Integer
Private Sub cmdope_Click(Index As Integer)
pv = Val(Text1.Text)
Select Case Index
Case 0
op = "+"
Case 1
op = "-"
Case 2
op = "*"
Case 3
op = "/"
End Select
Text1.Text = " "
End Sub
Private Sub cmdnum_Click(Index As Integer)
Text1.Text = Text1.Text + cmdnum(Index).Caption
End Sub
Private Sub cmdequal_Click()
Select Case op
Case "+"
Text1.Text = pv + Text1.Text
Case "-"
Text1.Text = pv - Text1.Text
Case "*"
Text1.Text = pv * Text1.Text
Case "/"
Text1.Text = pv / Text1.Text
End Select
Text1.Text = Round(Text1.Text, 2)
End Sub
Private Sub cmdcancel_Click()
Text1.Text = " "
End Sub
Private Sub cmdmem_Click()
m = Val(Text1.Text)
Text1.Text = " "
End Sub
Private Sub cmdmrecall_Click()
Text1.Text = m
End Sub
Private Sub Form_Load()
Form1.Show
End Sub
__________________________________________________ _____________________________________
1)I want to add any number with Negative number means what to do?? (i.e.,)-> -22+2=-20
How to do this?..
2)How to apply keypress event in this?
3)I can't retreive the memory value..Whenever i clicked the memrecall button only i can add any
number with that mem value..what i do??
Please send me the coding for all my doubts..
Eagerly Waiting for all Ur Reply..
ksvjb.
|