Results 1 to 6 of 6

Thread: Add onto Text in a textbox

  1. #1

    Thread Starter
    Lively Member moe222's Avatar
    Join Date
    Sep 2003
    Location
    Canada
    Posts
    68

    Angry Add onto Text in a textbox

    Hello,

    With a click of a button how can i make a certain word add onto a sentence in a textbox? Thx
    Moe

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Like:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     Text1.Text = Text1.Text & "NewWord"
    5. End Sub




    Bruce.

  3. #3
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Do like Bruce said if it's at the end (or beginning, except inverted), though if it's somewhere in the middle, you'd have to most likely use InStr with some Mid functions. I'll write something up for you if it is in the middle. Otherwise, ignore this

    PS. Option Explicit makes VB raise an error any time it encounters an undeclared variable when compiling (whether to .exe or just in the IDE)
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by jemidiah
    PS. Option Explicit makes VB raise an error any time it encounters an undeclared variable when compiling (whether to .exe or just in the IDE)
    Is this a question? If you have option explicit and an undeclared avriable it won't compile. It'll show an error...


    Has someone helped you? Then you can Rate their helpful post.

  5. #5
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    I guess I should have introduced that. I was actually referring to the Option Explicit in Bruce Fox's code
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  6. #6
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by jemidiah
    I guess I should have introduced that. I was actually referring to the Option Explicit in Bruce Fox's code
    Oh


    Has someone helped you? Then you can Rate their helpful post.

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