Solved Visual Studio 2005 RichTextBox - storing formatted text in project

Posted on 2006-05-12
Last Modified: 2008-01-09

I have a RichTextBox on a Windows form in a Visual Studio 2005 project.

The RichTextBox provides help data for my application. There will eventually be at least 100 pieces
of formatted text that I want to load into the RichTextBox when certain objects are selected.

Is it possible to create each piece of text in Word and save it in .rtf format then place it in my project?

Where would it be stored in the project so that it is part of the executable and how do I load it?

Furthermore, how do I programatically load this into the RichTextBox
Question by:murbro
    LVL 10

    Assisted Solution

    Public Sub CreateMyRichTextBox()
        Dim richTextBox1 As New RichTextBox()
        richTextBox1.Dock = DockStyle.Fill
        richTextBox1.Find("Text", RichTextBoxFinds.MatchCase)
        richTextBox1.SelectionFont = New Font("Verdana", 12, FontStyle.Bold)
        richTextBox1.SelectionColor = Color.Red
        richTextBox1.SaveFile("C:\MyDocument.rtf", RichTextBoxStreamType.RichText)
    End Sub
    LVL 96

    Accepted Solution


    1) You can create .RTF files, and embedded them in your application (if that's what you are asking for).

    2) Then you can use a StreamReader to get the file stream from the assembly manifest.


    Author Comment

    Thank you both.

    Bob I have posted a  further question on your answer. Would you be able to tell me a little more.

    Thanks again

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now