Webcontrol neuere Version

  • VB.NET
  • .NET (FX) 4.5–4.8

Es gibt 3 Antworten in diesem Thema. Der letzte Beitrag () ist von MarvinKleinMusic.

    Webcontrol neuere Version

    Hallo zusammen,

    Ich möchte gerne das in Visual Studio eingebundene Webbrowser Control aktualisieren, weil dieses ja standardmäßig als IE 7 fungiert und somit kein CSS3 und HTML5 unterstützt. Da das Programm jedoch auf Windows 7 oder höher nur läuft, möchte ich gerne eine neuere Version des Webcontrols nutzen, vorzugsweise IE 11.

    Vorweg: Ich möchte gezielt die Gecko und Webkit Engine nicht verwenden, um mir unnötigen Speicherverbrauch zu sparen.

    Also meine Frage:
    Gibt es einen Weg eine neuere Version des Webcontrols zu aktivieren? Wenn ja, wie stelle ich das an?

    Liebe Grüße,
    -Marvin
    Ich bin mir nicht sicher aber soweit ich weiß ist für WinForms nur der IE7 als Webbrowser eingebunden. Alleshöhere müsste eingebunden werden, da kannst du auch direkt Gecko verwenden.
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    So mit viel gegoogle habe ich nun die Antwort gefunden. Folgendes als Klasse hinzufügen:

    VB.NET-Quellcode

    1. ​Namespace My
    2. Partial Friend Class MyApplication
    3. Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
    4. CreateBrowserKey()
    5. End Sub
    6. Private Sub MyApplication_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
    7. ' I don't like applications that defecate in the registry and then don't cleanup their own mess
    8. ' so remove the key
    9. RemoveBrowerKey()
    10. End Sub
    11. Private Const BrowserKeyPath As String = "\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
    12. Private Sub CreateBrowserKey(Optional ByVal IgnoreIDocDirective As Boolean = False)
    13. Dim basekey As String = Microsoft.Win32.Registry.CurrentUser.ToString
    14. Dim value As Int32
    15. Dim thisAppsName As String = My.Application.Info.AssemblyName & ".exe"
    16. ' Value reference: http://msdn.microsoft.com/en-us/library/ee330730(v=VS.85).aspx
    17. ' IDOC Reference: http://msdn.microsoft.com/en-us/library/ms535242(v=vs.85).aspx
    18. Select Case (New WebBrowser).Version.Major
    19. Case 8
    20. If IgnoreIDocDirective Then
    21. value = 8888
    22. Else
    23. value = 8000
    24. End If
    25. Case 9
    26. If IgnoreIDocDirective Then
    27. value = 9999
    28. Else
    29. value = 9000
    30. End If
    31. Case 10
    32. If IgnoreIDocDirective Then
    33. value = 10001
    34. Else
    35. value = 10000
    36. End If
    37. Case 11
    38. If IgnoreIDocDirective Then
    39. value = 11001
    40. Else
    41. value = 11000
    42. End If
    43. Case Else
    44. Exit Sub
    45. End Select
    46. Microsoft.Win32.Registry.SetValue(Microsoft.Win32.Registry.CurrentUser.ToString & BrowserKeyPath,
    47. Process.GetCurrentProcess.ProcessName & ".exe",
    48. value,
    49. Microsoft.Win32.RegistryValueKind.DWord)
    50. End Sub
    51. Private Sub RemoveBrowerKey()
    52. Dim key As Microsoft.Win32.RegistryKey
    53. key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(BrowserKeyPath.Substring(1), True)
    54. key.DeleteValue(Process.GetCurrentProcess.ProcessName & ".exe", False)
    55. End Sub
    56. End Class 'MyApplication
    57. End Namespace


    Unterstützt wird dann IE 8,9,10 & 11