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 3487558
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:09:49+00:00 2026-05-18T11:09:49+00:00

i want my own Instant Messager (Chat). And the normal textbox doesn’t support formatted/colored

  • 0

i want my own Instant Messager (Chat). And the normal textbox doesn’t support formatted/colored text.
I read some articles about the Richtextbox in WPF and the new concept with Blocks, Paragraphs and Runs is pretty interesting.
Is it a good idea to serialize these objects and send them to the other chat-clients? (The text should be formatted, like the author’s orginal text)
If i want to add the blocks from the input-textbox to the output-textbox (only for testing), i get a exception that the blocks/paragraphs are used by an other richtextbox.
Then i saved the reference from these objects, removed it from the first textbox and added them to the second textbox.

 For example:


    FlowDocument oldTextDocument = richTextBoxMessageBox.Document;

            richTextBoxMessageBox.Document = new FlowDocument();

            while(oldTextDocument.Blocks.Count > 0)
            {
                richTextBoxChatHistory.Document.Blocks.Add(oldTextDocument.Blocks.FirstBlock);
            }

(I cant do it with for-each because this will cause a exception.)

  • 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-18T11:09:50+00:00Added an answer on May 18, 2026 at 11:09 am

    I don’t think it’s a good idea to send serialized objects to the other clients, because they will have some (considerable) overhead.

    I did some time ago a chat application and i used (successfully) the WebBrowser as the main control in the chat windows (which supports a lot of formating, rich media, etc), and I only send over the network html text (encrypted).

    Regarding your code, you cannot have the same instance of a Paragraph for example in two different controls, because it is a ContentElement – like you cannot have the same Label in two different panels.

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

Sidebar

Related Questions

Suppose my client doesn't want me to own his iPhone Distribution Certificate, is there
i want my own pascal code to be executed it also have some uses
How to write a getter that can not be deleted? I want to own
I want to create own filetype to save objects in my app. Basically, I
Hello I want write my own desktop sharing application in Java. The application should
I want to create my own IM and I'm searching an open-source IM APIs.
I want to output my own object to a STL stream but with customized
I want to create my own event - OnPositionChange . Event implementation of course
I want to make my own Start Menu replacement and I am trying to
I want to use my own existing model in GWT application. From what I've

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.