HELP me please with this programme i am a novice
VB Code:
Windows Form generated code
Dim strNumber As String
Dim decNum1 As Decimal
Dim decNum2 As Decimal
Dim chrOperator As Char
Dim decAnswer As Decimal
VB Code:
Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn0.Click, btn1.Click, btn2.Click, btn3.Click, btn4.Click, btn5.Click, btn6.Click, btn7.Click, btn8.Click, btn9.Click, btndecimal.Click
strNumber = strNumber & sender.text
lblanswer.Text = strNumber
End Sub
VB Code:
Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
If sender.text = "=" Then
decNum2 = strNumber
'work out your answer here and display it in the label.
'Put the answer into decnum1i think this is right?
Else
decNum1 = strNumber
chrOperator = sender.text
End If
strNumber = ""
End Sub
VB Code:
Private Sub btnequals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnequals.Click
If sender.text = "=" Then
lblanswer.Text = decAnswer
End If
End Sub
End Class
ok thats all the code i have i need to work out that middle bit in bold could anyone clear this up for me or give me the code to simple similar calculator program thank you for helping :(
Re: HELP me please with this programme i am a novice
first of all you need to have a more specific description of your problem in the forum. "help me I dont know what I am doing" is terrible. is this a homework assignment?
Re: HELP me please with this programme i am a novice
Please HELP ME !!!!!!!!!!
Re: HELP me please with this programme i am a novice
VB Code:
Windows Form generated code
Dim strNumber As String
Dim decNum1 As Decimal
Dim decNum2 As Decimal
Dim chrOperator As Char
Dim decAnswer As Decimal
VB Code:
Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn0.Click, _
btn1.Click, btn2.Click, btn3.Click, btn4.Click, btn5.Click, btn6.Click, btn7.Click, btn8.Click, btn9.Click, btndecimal.Click
lblAnswer.Text = Nothing
if chrOperator = Nothing then
decNum1 = sender.text
else
decNum2 = sender.text
end if
End Sub
VB Code:
Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
chrOperator = "+"
End Sub
VB Code:
Private Sub btnequals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnequals.Click
Select Case chrOperator
Case "+"
lblAnswer.Text = decNum1 + decNum2
End Select
decNum1 = Nothing
decNum2 = Nothing
chrOperator = Nothing
End Sub
End Class
Re: HELP me please with this programme i am a novice
well thanks for those that helped and no it wasnt a homework assignment it is for a business website that im creating anyway that shouldnt matter geez :sick: :ehh:
Re: HELP me please with this programme i am a novice
Don't get ants in the pants, you need to help us help you. help us help you that's all.
Re: HELP me please with this programme i am a novice
im sorry but i am beyond help i dont know anything about vb.net (i want to and try) i cannot explain something i dont understand :(