• Advertisement
Sign in to follow this  

Need help with a basic visual basic program.

This topic is 4369 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?
    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

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by CadeF
Try changing TextBox5.Name to TextBox5.Text

I think he means Label3 and not TextBox5.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement