CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Posts
    36

    Replace Text with textBox

    Hello,

    I'm trying to replace text within a textBox . I have it working with one set, if I uncomment two if these lines, it does not work.

    I have been trying to figure out how to append it, then I think it might work for me.

    textBox6.Text = textBox3.Text.Replace("A", "1");
    //textBox6.Text = textBox3.Text.Replace("a", "1");
    //textBox6.Text = textBox3.Text.Replace("B", "2");
    //textBox6.Text = textBox3.Text.Replace("b", "2");
    //textBox6.Text = textBox3.Text.Replace("C", "3");
    //textBox6.Text = textBox3.Text.Replace("c", "3");

    So, if I have a text value of Apple, it would be 1pple, this works, but if I uncomment line with the B, it will not work. If say the word was BAT, it would be 2120, because T = 20

    What can I do to make this work.

    Thanks,

    Mike
    Last edited by netman06; July 1st, 2014 at 11:33 PM. Reason: Resolved

  2. #2
    Join Date
    May 2012
    Posts
    36

    Re: Replace Text with textBox

    I got it to work!

    Mike

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Replace Text with textBox

    Share your answer

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

Featured