Only with the title. The title needs to have a description of your error, say "Add numbers in labels". Being new, no harm no foul.:)
As far as your question goes, what bexactly do you need if you are not going to get the sum of both. If you click on pic1, label 1 shows 1, why then add the 1 to label 3 as well?
@Abe, your code will not work. You need to declare the sum first -
Private Sub Command1_Click()
Dim Sum As Integer
Sum = Val(Text1.Text) + Val(Text2.Text)
Label3.Caption = Sum
End Sub
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
No it will not. If the OP starts with more advanced coding, he is going to fall into a pitfall, bugging his application. If we do give advice, we give the correct advice.:)
It still works without declaring sir
It will because "Sum" is a function within vb6. What if the OP uses it as a string, as you suggested? This means that if a user adds MyPic12345 it will be declared, as where an integer will throw an error, only wanting numbers, 12345. This is the correct way to make your application bug free.;)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350