d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Visual Basic Noob Question > Help D:
Add Reply New Topic New Poll
Member
Posts: 7,671
Joined: May 24 2012
Gold: Locked
Warn: 30%
Sep 22 2012 01:23pm
Hello geeks, smart people, aka reason of worlds development.

I got a a problem and im a total nuby at coding stuff.

Code:
("+" button)
Label2.Text = "+"
Label4.Text = Val(TextBox1.Text) + Val(TextBox2.Text)


Dim SAPI
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak("plus")
--------------------------
Button for number : "1"

If Label2.Text = "?" Then
TextBox1.Text += "1"
End If
If Label2.Text = "+" Then
TextBox2.Text += "1"
End If

Dim SAPI
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak("one")

I got an equal label that keeps Getting "1" when i press the "+" button, Would someone be very kind and tell me how to write it insted becouse i cannot find out how, im a total nub.
I only want my Equal label to show the value once i hit my = button. it does give the correct answer but i dont want the ("1") every time i press ("+")

thanks in advance :)
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 22 2012 06:57pm
for starters, give your labels/textboxes a better name than Label1 and TextBox1.

i think this is the code you want to remove:

Label4.Text = Val(TextBox1.Text) + Val(TextBox2.Text)

put that in your btnEquals_clicked event instead.
Member
Posts: 7,671
Joined: May 24 2012
Gold: Locked
Warn: 30%
Sep 25 2012 07:05am
solved
had to delete some rows ^^
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll