I need some help on this program that i have. i can't seem to get it to work.
any comment on the program would be appreciated.
Thx in advance.
I have uploaded my program in case u need to take a look.
Dim first As Double
Dim second As Double
Dim sign As String
Private Sub lbldot_Click()
If InStr(txtdisplay.Text, ".") = 0 Then
txtdisplay.Text = txtdisplay.Text & "."
End If
End Sub
Private Sub lblnumber_Click(Index As Integer)
If txtdisplay.Text = "" Then
txtdisplay.Text = lblnumber(Index).Caption
Else
txtdisplay.Text = txtdisplay.Text & lblnumber(Index).Caption
End If
End Sub
Private Sub lblsign_Click(Index As Integer)
first = txtdisplay.Text
txtdisplay.Text = ""
sign = lblsign(Index).Caption
End Sub
Private Sub cmdEq_Click()
txtdisplay.Text = second
sign = lblsign(Index).Caption
If sign = "-" Then
txtdisplay.Text = first - second
ElseIf sign = "+" Then
txtdisplay.Text = first + second
ElseIf sign = "*" Then
txtdisplay.Text = first * second
ElseIf sign = "/" Then
txtdisplay.Text = first / second
End If
End Sub
Private Sub cmdClear_Click()
txtdisplay.Text = ""
End Sub
Private Sub cmdDot_Click()
If InStr(txtdisplay.Text, ".") = 0 Then
txtdisplay.Text = txtdisplay.Text & "."
End If
End Sub
Private Sub Form_Load()
txtdisplay.Enabled = False
End Sub