Sign in to follow this  
Dko

Need help with a basic visual basic program.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this