Note: Advice in this article will only work for DotNetBrowser 1.
See the corresponding article for DotNetBrowser 2 here.
If you need to cancel or disable printing at all you can use the following approach. First, you need to implement a custom print handler. A sample print handler that disables printing is given below.
C#
class SamplePrintHandler : PrintHandler { public PrintStatus OnPrint(PrintJob printJob) { return PrintStatus.CANCEL; } }
VB.NET
Class SamplePrintHandler Implements PrintHandler Public Function OnPrint(printJob As PrintJob) As PrintStatus Implements PrintHandler.OnPrint return PrintStatus.CANCEL End Function End Class
Then, you need to replace current PrintHandler
with the new one:
C#
browser.PrintHandler = new SamplePrintHandler();
VB.NET
browser.PrintHandler = new SamplePrintHandler()