I use in the webBrowser control project. Everything worked, but after updating the computer (OS: windows 10), the ShowPrintPreviewDialog () method stopped working. The print dialog box opens, but it is empty. At the same time, there is content in the DocumentText property. The content view window also opens, everything is displayed correctly.

webBrowser1.DocumentText = Content; webBrowser1.ShowPrintPreviewDialog(); 

Tell me what's wrong? How is it possible to solve this problem?

    2 answers 2

    Here is the link to MSDN: WebBrowser.ShowPrintPreviewDialog . There is such a text:

    Platforms

    Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98 The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see the .NET Framework System Requirements.

    Version Information

    .NET Framework Supported in: 3.5, 3.0, 2.0

    I think that you should roll. .NET Framework 3.5 on your system. Or roll back updates to the working version and wait for updates that will fix everything. I bow to the second option, because it is more correct.

    Installing the .NET Framework 3.5 on Windows 8, Windows 8.1 and Windows 10

    • still worked with NET Framework 4.5.1 and Windows10. And there is no possibility to roll version 3.5 since the project uses assemblies that are not in this version - Vladimir Tsybin
    • @VladimirTsybin, apparently the system updates caused the failure of this component. Go to Программы и компоненты , then the tab Включение и отключение компонентов Windows and try to turn on version 3.5 . I rarely update the system, so it works for me on 8.1 and 10. - Denis Bubnov
    • @VladimirTsybin, nothing terrible and critical should happen if you add 3.5 to the system. At least nothing happened to me, did it several times. - Denis Bubnov
    • Here is the link where it is said that it is supported in version 4 link , but this is not necessary at least 4.5 - Vladimir Tsybin
    • @VladimirTsybin, either roll back the updates, or roll the framework. Well, somehow I do not see another solution. Microsoft has such a habit - not to maintain the old functionality, to create new and promote the new, if you want the old one - install the old version. Well, something like that ... - Denis Bubnov

    Casket just opened. The reason why the ShowPrintPreviewDialog () method does not work
    The default printer was not installed;)