Results 1 to 8 of 8

Thread: How do l change a textbox's label

  1. #1

    Thread Starter
    Member DragonFly's Avatar
    Join Date
    Feb 2002
    Location
    Down Under
    Posts
    59

    Question How do l change a textbox's label

    Depending on what is put in a textbox l want to change the label, (what appears in the window) of a second text box. Is this possible?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    not quite sure what that means... but i've guessed


    Dim strabc as string
    strabc = text1.text

    select case strabc

    case "":
    text2.text = "empty"

    case "goo goo dolls":
    text2.text = "the best!!!"

    case "whatever"
    text2.text = "hey yo!"

    end select




    Is this what you meant? or could u be a bit more clear?

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Try:
    VB Code:
    1. IF Something.... Then
    2. Text2.Text = Text1.Text ' Or what ever u need to do
    3. End IF
    ________
    Washington dispensaries
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:37 AM.

  4. #4

    Thread Starter
    Member DragonFly's Avatar
    Join Date
    Feb 2002
    Location
    Down Under
    Posts
    59
    To clarify - it's not what appears in the text box - but what appears in the text box's label

    Sorry it's probably a bit lame - but I am a newbie at this!

  5. #5
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    I didn't think Text Boxes had labels

  6. #6
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    i think he means the InputBox() function... dont you?

    here's an example of what you mean...

    VB Code:
    1. Private Sub Form_Load()
    2.     Dim str As String
    3.    
    4.     str = InputBox("Enter title of next input box", "Input")
    5.     InputBox "OK?", str
    6. End Sub
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  7. #7
    Jethro
    Guest
    Simple really,

    Code:
    Private Sub Text1_LostFocus()
    
       If Text1 = "Something" Then
           Label2.Caption = "Whatever"
       End If
    
    End Sub

  8. #8

    Thread Starter
    Member DragonFly's Avatar
    Join Date
    Feb 2002
    Location
    Down Under
    Posts
    59
    Originally posted by Jethro
    Simple really,

    Code:
    Private Sub Text1_LostFocus()
    
       If Text1 = "Something" Then
           Label2.Caption = "Whatever"
       End If
    
    End Sub
    Thank you will give it a go

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