Results 1 to 13 of 13

Thread: [Help] Get text what I typed in a Textbox..

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2009
    Location
    Belgium
    Posts
    58

    [Help] Get text what I typed in a Textbox..

    Hello I am making someting like, Example:
    Code:
    Name: RyDeR (RyDeR is what I typed in the Textbox) 
    Age: 17 (17 is what I typed in the Textbox)
    But now I have another Textbox but I want that this textbox automatic changes with what I type in the first boxes. Example:
    Code:
    His name is 'RyDeR' 
    He's '17' years old
    .. Like this and if I type something else, it must change to in last textbox.

    I hope I explained it good..
    Waiting for all help of you guys..

    Kind Regards..

  2. #2
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    407

    Re: [Help] Get text what I typed in a Textbox..

    sounds like a high school problem. So I'll basically help you on what you would need to do.

    You would need a button that has the user clicks to update the new text box. Then you would need an integer and a string that holds the template string. Then you would combine the string and the integer into one string and then display that into the last text box when the user clicks on the button. EASY!
    My Websites
    SharpMP3 - MP3 Design Articles www.sharpmp3.com
    Yobbers - Job Search www.yobbers.com
    Lets Trend - Methods For Riding Stock Trends www.letstrend.com

  3. #3
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: [Help] Get text what I typed in a Textbox..

    Use the TextChanged event of the first textbox.

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [Help] Get text what I typed in a Textbox..

    Quote Originally Posted by jakkjakk View Post
    sounds like a high school problem. So I'll basically help you on what you would need to do.

    You would need a button that has the user clicks to update the new text box. Then you would need an integer and a string that holds the template string. Then you would combine the string and the integer into one string and then display that into the last text box when the user clicks on the button. EASY!
    Why would you need an Integer and a String? If all you are doing is displaying them both in text boxes then they should both be Strings
    Having said that, I would agree with Minitech that the easiest way would be to just use the TextChanged event of the first textbox to set the Text property of the other text box to whatever the value of the Text property on the input textbox is
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2009
    Location
    Belgium
    Posts
    58

    Re: [Help] Get text what I typed in a Textbox..

    It's not a High school problem ^^ I started new with this and I don't realy know how..
    I actually want to make a program to make 'pawno' scripts easier..

    Thank you for the code 'TextChanged' But I can't do anything whitout example
    I'm new.. I'll try to learn so fast as I can.
    So I need an example please? Oh ye It's VB 2008.

    Kind Regards.

  6. #6
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: [Help] Get text what I typed in a Textbox..

    vb.net Code:
    1. Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles Me.TextBox1.TextChanged
    2.         Select Case Me.TextBox1.Text
    3.                 Case "RyDeR"
    4.                         Me.TextBox2.Text = "17"
    5.                 Case "SoMeOnEeLse"
    6.                         Me.TextBox2.Text = "32"
    7.                 'etc...
    8.         End Select
    9. End Sub

    You understand?

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [Help] Get text what I typed in a Textbox..

    Or
    vb.net Code:
    1. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
    2.         TextBox2.Text = "His name is " & TextBox1.Text
    3. End Sub
    and you figure out how to incorporate the age.

  8. #8

    Thread Starter
    Member
    Join Date
    Sep 2009
    Location
    Belgium
    Posts
    58

    Re: [Help] Get text what I typed in a Textbox..

    Thank you both It's actually easy but you have to know all the params and the codes then it's easy ^^

    Kind Regards

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [Help] Get text what I typed in a Textbox..

    Yeah, jargon can make any task difficult. What the heck is a pawno script? The only thing I can think of is too laughable to even mention (even if it wouldn't get me banned, which it might).
    My usual boring signature: Nothing

  10. #10

    Thread Starter
    Member
    Join Date
    Sep 2009
    Location
    Belgium
    Posts
    58

    Re: [Help] Get text what I typed in a Textbox..

    Example pawno:

    http://wiki.sa-mp.com/wiki/PAWN_tutorial_1

    I don't know or I may give links so forgive me ..

  11. #11
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [Help] Get text what I typed in a Textbox..

    Ah, I see. Never heard of it, which is not entirely surprising.
    My usual boring signature: Nothing

  12. #12

    Thread Starter
    Member
    Join Date
    Sep 2009
    Location
    Belgium
    Posts
    58

    Re: [Help] Get text what I typed in a Textbox..

    One more thing
    How to add more text in a RichTextBox1.Text = "{" example.
    I write this, and an other one to, but only one line is comming up..
    Last edited by Ryder_; Sep 28th, 2009 at 03:58 PM.

  13. #13
    Hyperactive Member BadgerBadger's Avatar
    Join Date
    Aug 2009
    Location
    Wales
    Posts
    382

    Re: [Help] Get text what I typed in a Textbox..

    "Pawno" is just an IDE per se for the language "PAWN" which is used to develop game modes and plugins for SA-MP (San Andreas Multiplayer).
    I made quite a few SA-MP game modes in my time.
    I'm not really sure how you can make a program to help use PAWNO since its an IDE with all the methods and callbacks included, but hey, whatever floats your boat!
    "The only thing that interferes with my learning is my education."

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