0

I'm attempting to use the CefSharp.WinForms.ChromiumWebBrowser web browser (file ver: 73.1.130.0) to render some HTML (basically a report) that is passed to a VB.NET user control as a string.

The information that I have seen says to use the LoadHtml() method but this does not appear to be accessible or exist.

Further information revealed that I may need to use an extension to access this method which I have no idea how to accomplish (despite hunting around the web for the last hour).

Would someone be able to point me in the right direction or let me know if this is even possible?

This is the second from last conversion from our old IE browser to the chromium one. a basic outline of what I have below:

Public Class SanctionsCheckerReport
    Public Sub New(ByRef reportHtml As String)
        InitializeComponent()
        
        Dim webBrowser As New CefSharp.WinForms.ChromiumWebBrowser(String.Empty)
        webBrowser.LoadHtml(reportHtml)

        webBrowser.Dock = DockStyle.Fill
        Me.Controls.Add(webBrowser)
        webBrowser.BringToFront()
    End Sub
    
    '....
    
End Class

I would really appreciate any help you can give.

Thanks.

Craig
  • 2,248
  • 1
  • 19
  • 23

1 Answers1

0

Found the answer thanks to the comment from @Björn in question: CefSharp LoadHtml

I just need to add an import to CefSharp to expose the method.

Imports CefSharp

Public Class SanctionsCheckerReport
    Public Sub New(ByRef reportHtml As String)
        InitializeComponent()
        
        Dim webBrowser As New CefSharp.WinForms.ChromiumWebBrowser(String.Empty)
        webBrowser.LoadHtml(reportHtml)

        webBrowser.Dock = DockStyle.Fill
        Me.Controls.Add(webBrowser)
        webBrowser.BringToFront()
    End Sub
    
    '....
    
End Class

Thanks