Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB.net/ Visual Studio 2005 RichTextBox - storing formatted text in project

Posted on 2006-05-12
3
Medium Priority
?
414 Views
Last Modified: 2008-01-09
Hi

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
0
Comment
Question by:Murray Brown
3 Comments
 
LVL 10

Assisted Solution

by:vadim63
vadim63 earned 800 total points
ID: 16669151
Public Sub CreateMyRichTextBox()
    Dim richTextBox1 As New RichTextBox()
    richTextBox1.Dock = DockStyle.Fill
   
   
    richTextBox1.LoadFile("C:\MyDocument.rtf")
    richTextBox1.Find("Text", RichTextBoxFinds.MatchCase)
   
    richTextBox1.SelectionFont = New Font("Verdana", 12, FontStyle.Bold)
    richTextBox1.SelectionColor = Color.Red
   
    richTextBox1.SaveFile("C:\MyDocument.rtf", RichTextBoxStreamType.RichText)
   
    Me.Controls.Add(richTextBox1)
End Sub
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1200 total points
ID: 16670982
Murray,

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.

Bob
0
 

Author Comment

by:Murray Brown
ID: 16673414
Thank you both.

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

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21849248.html

Thanks again
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

810 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