Results 1 to 5 of 5

Thread: [Resolved] [2008] Choose which label to write to

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    73

    Thumbs up [Resolved] [2008] Choose which label to write to

    Hey, I have a form with 3 labels, a textbox and a button. I want to write a number in the textbox (1-3) and then press the button. Then, if the number in the textbox is 1, I want to write in label1 "TEST", if it's 2 I want to write in label2 etc. I know I can do it with a whole lot of if statements, but I think there has to be a way to do it simply.

    I've tried this:

    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Label(TextBox1.Text).text = "TEST"
        End Sub
    But it obviously didn't work...

    Hope someone can help
    Last edited by want a pie; Oct 29th, 2008 at 06:32 PM. Reason: resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width