• Log in or sign up for an account here: https://www.sythe.org/login

[Help] text1 + label1

leder678

Newcomer
Joined
Jan 4, 2008
Sythe Gold
0
Messages
4
I have a code, were if i click on a command button, the result should be

text1 + label1 = 150

but it become text1 + label1 = 10050

here are the code

Code:
Private Sub Command1_Click()
Text1 = Text1.Text + Label1.Caption
End Sub

*NB!: i have tested text1.text + label1.caption etc.
 
Two Factor Authentication User
The problem is because you are adding 2 strings together. You need to convert them to numbers first.
Code:
 Text1 = CDbl(Text1.Text) + CDbl(Label1.Caption)
 
Valentine's Singing Competition Winner
Sythe Awards 2015 Winner
Sythe Awards 2016 Winner
Sythe Awards 2020 Winner
Member of the Month Winner
MushyMuncher
Gohan has AIDS
Extreme Homosex
World War 3
I'm LAAAAAAAME
Discord Verified
Off Topic Participant
You should always define the property of the output area as well, it just makes things more neat. So instead of Text1 = , you'd have Text1.Text = .
 
Runescape Gamblingrunescape gambling
Back
Top