Home > Enterprise >  Div is dragged instead of horizontal scroll in WebBrowser
Div is dragged instead of horizontal scroll in WebBrowser

Time:03-14

In a WinForm application (Framework 3.5) with IE11 a simple HTML page with a horizontally scrollable content instead of scrolling drags the page:

enter image description here

While if i open IE11 standalone it scrolls as have to.

The WebBrowser is created as the following:

Private Sub VediTagli()
    Dim webNEWTES As New WebBrowser
    webNEWTES.Name = "webNEWTES"

    webNEWTES.ScriptErrorsSuppressed = True
    'webNEWTES.WebBrowserShortcutsEnabled = False
    webNEWTES.IsWebBrowserContextMenuEnabled = False



    'AddHandler webNEWTES.DocumentCompleted, AddressOf webNEWCLI_DocumentCompleted
    AddHandler webNEWTES.Navigating, AddressOf webNEWTES_Navigating
    AddHandler webNEWTES.DocumentCompleted, AddressOf webNEWTES_DocumentCompleted
    webNEWTES.Top = lstDETT.Top
    webNEWTES.Left = lstDETT.Left
    webNEWTES.Height = lstDETT.Height
    webNEWTES.Width = lstDETT.Width




    webNEWTES.Visible = True
    If SONO_IN_MODIFICA_BP = True Then
        webNEWTES.Navigate("http://127.0.0.1/webquery/VisualTicket.aspx?ORARIO=" & Format(DateTime.Now, "HH.mm.ss"))
    Else
        webNEWTES.Navigate("http://127.0.0.1/webquery/VisualTicket.aspx?client=true" & "&ORARIO=" & Format(DateTime.Now, "HH.mm.ss"))
    End If

    'webNEWTES.Url = New Uri("http://127.0.0.1/webquery/VisualTicket.aspx?client=true")
    'webNEWTES.Navigate(IP_CREACLI & "&ORARIO=" & Format(DateTime.Now, "HH.mm.ss"), Nothing, Nothing, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)")

    'webNEWTES.DocumentText = ""
    'webNEWTES.Navigate("about:blank")
    webNEWTES.BringToFront()
    Panel2.Controls.Add(webNEWTES)
End Sub

CodePudding user response:

The issue was solved by disabling Legacy Input Model in sys register.

As per docs it was needed to disable FEATURE_NINPUT_LEGACYMODE as following:

HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
   SOFTWARE
      Microsoft
         Internet Explorer
            Main
               FeatureControl
                  FEATURE_NINPUT_LEGACYMODE
                     contoso.exe = (DWORD) 00000000
  • Related