Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6136609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:37:29+00:00 2026-05-23T17:37:29+00:00

I seem to be experiencing a very unusual issue with the RichTextBox control, programming

  • 0

I seem to be experiencing a very unusual issue with the RichTextBox control, programming in C# in Visual Studio 2008.

I’m currently reading the stream of a file that’s being written to by the windows console (with output redirection), and I’m reading it into my program (essentially, I’m recreating what’s known in the unix world as “tail”).

When an array of bytes is read in, I’d like to return to a new line line, and continue reading. However, it seems like my RTB will not respond to new line or carriage return characters. For example, I’ve tried appending \n, \r\n, and even Environment.NewLine to the string being written, but nothing seems to be working. It just keeps writing across the same line.

Here is the code that seems to be causing trouble:

string convertedBuffer = System.Text.Encoding.UTF8.GetString((byte[])e.UserState);

outputBox.AppendText(convertedBuffer + "\n");

I’m really at a loss here, can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:37:29+00:00Added an answer on May 23, 2026 at 5:37 pm

    Its probably because you set outputBox.Multiline property to false which will will prevents the control from showing the text in multi-line.

    Edit: You stated at comment

    the byte array that is being sent was one that I made of set size, 512. I now just changed that to one that actually fits the data being filled in it, and now, all of a sudden, the newline character starts working again

    Here is what happened:

    The string class in C# is an array of char start by pointer to the first char in the array and ends by the special “terminal” char \0. So when you call System.Text.Encoding.UTF8.GetString(buffer) if the buffer size is larger than the string size it will set the all remaining chars of the string to the terminal char in the char array. the array of chars will be something like some text\0\0\0, So I am guessing that when you add Environment.NewLine it will add it to the last index of the char array after last \0 and then the char array will be some text\0\0\r\n and because of the new line is after the terminal it will ignore it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently experiencing a weird caching problem it would seem. When I load
I'm experiencing the same problem in this previous stackoverflow.com post . Specifically, I seem
Seem to be having an issue with std::auto_ptr and assignment, such that the object
I seem to remember reading something about how it is bad for structs to
I'm fairly new to OpenGL, and I seem to be experiencing some difficulties. I've
I know that may seem weird and looking for troubles but I think experiencing
I'm experiencing a bizarre and frustrating scenario and I can't seem to track it's
I can't seem to figure this out. I'm experimenting with MVC Beta and am
I seem to be missing something about LINQ. To me, it looks like it's
There seem to be many ways to define singletons in Python. Is there a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.