CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2008
    Posts
    161

    [RESOLVED] "Cycling" through a richtextbox

    Alright, i have an application in which the user inputs information into a rich textbox separated by enter spaces. Lets say i want to display all of that information once at a time in a message box.

    Eg.
    Code:
    Foo
    Foobar
    Foobr
    i want to do a messagebox.show each one of those individually except on a mass scale like 100. On a single button click.

    maybe use a method so i could do something like "messagebox.show(showinformation());"

    How could i go about doing this?

    Thank you,

    Pale.

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: "Cycling" through a richtextbox

    Use String.Split() method to split the text in Richtextbox.

  3. #3
    Join Date
    Mar 2008
    Posts
    161

    Re: "Cycling" through a richtextbox

    Quote Originally Posted by Shuja Ali
    Use String.Split() method to split the text in Richtextbox.
    How do i make that do an enter space between the text?

  4. #4
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: "Cycling" through a richtextbox

    String.Split() will split a string on a specific character. The character int value for a carriage return is 13.

  5. #5
    Join Date
    Sep 2004
    Posts
    1,361

    Re: "Cycling" through a richtextbox

    How about:

    MessageBox.Show(MyString.Replace("\n", "\r\n"));

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