[RESOLVED] How to load an RTF file
Hi! I would like to show a RTF file in a RichTextBox control. I read there is a loadfile method which requires the path to the RTF file. I would like to deploy this file with my installation, so I suppose I have to insert it as a resource file. But, how can I provide the path to this RTF resource to the method to load the RTF?
Thanks!
Re: How to load an RTF file
Code:
'Where "Document" is the file name you added to your resources
RichTextBox1.Rtf = My.Resources.Document
Re: How to load an RTF file
Either that, or if you want the application to load an external file you could use the startup path. I use this:
Public startuppath As String = My.Application.Info.DirectoryPath & "\"
And then, you'd use:
RichTextBox1.Rtf = startuppath & "RTF File.rtf"
Re: How to load an RTF file
Great! Thank you very much!