Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged
Dim Modtemp As Integer, counter As Integer
Modtemp = -5
Do While counter <= Val(TextBox5.Name)
Modtemp = Modtemp + 1
counter = counter + 2
Loop
Label13.Name = Modtemp.ToString
End Sub
Need help with a basic visual basic program.
I useto be very learned in VB 6.0 but its been a while sence and now I have .net 2005. I have a text box and a label. Ive been trying to have it when a number is typed into the text box that the labels value will change based on this.
Text box Label
1 -5
2-3 -4
4-5 -3
6-7 -2
8-9 -1
10-11 0
12-13 1
etc...
For some reason a value never appears in the label. Nothing in my code seams to be off. But im not sure. Could anyone give me a little help debuging it?
Quote:Original post by CadeF
Try changing TextBox5.Name to TextBox5.Text
I think he means Label3 and not TextBox5.
I haven't been programming in Visual Basic for very long, but I think you need to replace the Label13.Name with Label13.caption. .text is only used when you want something to appear in a text box.
Quote:Original post by spacemonkey90
I haven't been programming in Visual Basic for very long, but I think you need to replace the Label13.Name with Label13.caption. .text is only used when you want something to appear in a text box.
Not true...in all my dealings with VB, the Text property is what I have modified for labels and everything thus far has gone smoothly. I'm not saying changing the Caption property won't work, I'm just saying that the Text property will also work.
-AJ
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement