Nevron Forum

Load HTML File

https://www.nevron.com/Forum/Topic9566.aspx

By Roman Sallin - Saturday, January 30, 2016

Hi
I have RichTextViewWithRibbon control on a form. How do I load a HTML file into this control? There is not Load-method for this control. I tried the Widget property but that did not help. There is no simple example in the documentation. I found no tutorial for such simple tasks. The example project does not show how to access...
Best regards
By Nevron Support - Wednesday, February 3, 2016

Hi,

You should first get the rich text view widget of the NRichTextViewWithRibbonControl by using the GetFirstDescendant method of its widget and then you can use the LoadFromFile method of the rich text view to load a file. Here's a C# code sample:


NRichTextViewWithRibbon richTextWithRibbon = nRichTextViewWithRibbonControl1.Widget;
NRichTextView richTextView = (NRichTextView)richTextWithRibbon.GetFirstDescendant(NRichTextView.NRichTextViewSchema);
richTextView.LoadFromFile(@"C:\Documents\MyFile.html");

By Roman Sallin - Friday, February 5, 2016

Thank you very much! That solved the problem.