-
I have a problem with countig (VB3):
The caption of Label1 is '3'
The caption of Label2 is '6'
I want to add up the two numbers, but VB always
wirtes 36 instead of 9 with this method:
Label3.caption = Label1.caption + Label2.caption
I want that the two numbers are added and I don't
want to use a text-box.
Thanks for some advice, Matt-D(eutschland) ;)
-
Force the weak typecast
DIM i as integer
i = Label1.Caption
i = i + Label2.Caption
Label3.Caption = i
or...
Label3.Caption = CInt(Label1.Caption) + CInt(Label2.Caption)
-
try this
Label3.caption = Val(Label1.caption) + Val(Label2.caption)
-