Load HTML File


https://www.nevron.com/Forum/Topic9566.aspx
Print Topic | Close Window

By Roman Sallin - 5 Years Ago
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 - 5 Years Ago
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 - 5 Years Ago
Thank you very much! That solved the problem.