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

  • Home
  • SEARCH
  • 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 9278301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:19:55+00:00 2026-06-18T17:19:55+00:00

There’s got to be a better way to do this than what I’m doing.

  • 0

There’s got to be a better way to do this than what I’m doing.

I’m trying to extract the raw RTF from a WPF RichTextBox. Well, really I’m trying to take a bunch of my custom classes and turn it into an RTF string, but I’m using a RichTextBox to do it because I don’t particularly want to write my own RTF library.

The method I’m using (modified from something first seen here and used to extract XML here) is as follows:

RTB.Selection.Save(memstream, DataFormats.Rtf);
memstream.Seek(0, SeekOrigin.Begin);
var sr = new StreamReader(memstream);
var myText = sr.ReadToEnd();

This works, but seems ridiculously clumsy. And I’m worried about the performance implications on large amounts of text. Is there a better way? (For the purpose of this question, let’s assume that I can’t use the WinForms RichTextBox.)

  • 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-06-18T17:19:57+00:00Added an answer on June 18, 2026 at 5:19 pm

    use this question.

    string mpic = @"{\pict\pngblip\picw" + 
        img.Width.ToString() + @"\pich" + img.Height.ToString() +
        @"\picwgoal" + width.ToString() + @"\pichgoal" + height.ToString() + 
        @"\bin " + str + "}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a column that exists in 2 tables. In table 1, this column
There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
There are nice SO question and answers about this issue, but these options didn't
There is any way to set the generic type (T) of class in the
For some reason, after submitting a string like this Jack’s Spindle from a text
There is a tool or maybe better, a server side script to check if
There is no view controller or any interfacebuilder, I want to build this with
There's IsAssignableFrom method returns a boolean value indicates if one type is assignable from
There's the thing : I have this Url Rewriting condition in my .htaccess :

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.