使用JavaScript站点在触摸屏上进行C#Side滚动

使用JavaScript站点在触摸屏上进行C#Side滚动,c#,html,css,knockout.js,C#,Html,Css,Knockout.js,我们有一个C#容器,一个Windows.Form.WebBrowser类被调用,在一个没有垂直滚动(只有水平滚动)的网站上 使用触摸屏在Internet Explorer、Chrome和Firefox中滚动效果很好,但是当网站在Windows.Form.WebBrowser中启动时,触摸滚动不起作用。它注册触摸/拖动事件,就像在不抓取网站的情况下单击并拖动鼠标一样 它还将选择以下网站上的文本 我们创建了一个示例站点来演示该问题: 命名空间窗口窗体应用程序1 { 部分类Form1 { ///

我们有一个C#容器,一个Windows.Form.WebBrowser类被调用,在一个没有垂直滚动(只有水平滚动)的网站上

使用触摸屏在Internet Explorer、Chrome和Firefox中滚动效果很好,但是当网站在Windows.Form.WebBrowser中启动时,触摸滚动不起作用。它注册触摸/拖动事件,就像在不抓取网站的情况下单击并拖动鼠标一样

它还将选择以下网站上的文本

我们创建了一个示例站点来演示该问题:

命名空间窗口窗体应用程序1
{
部分类Form1
{
/// 
///必需的设计器变量。
/// 
private System.ComponentModel.IContainer components=null;
/// 
///清理所有正在使用的资源。
/// 
///如果应释放托管资源,则为true;否则为false。
受保护的覆盖无效处置(布尔处置)
{
if(处理和(组件!=null))
{
组件。Dispose();
}
基地。处置(处置);
}
#区域Windows窗体设计器生成的代码
/// 
///设计器支持所需的方法-不修改
///此方法的内容与代码编辑器一起使用。
/// 
私有void InitializeComponent()
{
this.webBrowser1=new System.Windows.Forms.WebBrowser();
这个.SuspendLayout();
// 
//webBrowser1
// 
this.webBrowser1.Dock=System.Windows.Forms.DockStyle.Fill;
this.webBrowser1.Location=新系统.Drawing.Point(0,0);
this.webBrowser1.MinimumSize=新系统图纸尺寸(20,20);
this.webBrowser1.Name=“webBrowser1”;
this.webBrowser1.ScrollBarsEnabled=false;
this.webBrowser1.Size=新系统图纸尺寸(24191088);
this.webBrowser1.TabIndex=0;
this.webBrowser1.Url=new System.Uri(“https://beta.slimcrm.com/sideScrollTest.html“,System.UriKind.Absolute);
this.webBrowser1.AllowNavigation=false;
// 
//表格1
// 
this.AutoScaleDimensions=新系统.Drawing.SizeF(16F,31F);
this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize=新系统.Drawing.Size(24191088);
this.Controls.Add(this.webBrowser1);
this.Name=“Form1”;
this.Text=“Form1”;
此选项为.resume布局(false);
}
#端区
private System.Windows.Forms.WebBrowser webBrowser1;
}
}
我们有两名开发人员,他们在本网站和互联网上搜索了2天,但我们似乎没有尝试让C#Windows.Form.WebBrowser注册触摸事件并将网站拖到左侧


我们认为它必须与C#相联系,因为触摸屏上的拖动事件在所有web浏览器中都非常有效。该网站的框架是Knockout.js,Restful API,都在一个C#容器中。

我想你可能运气不好。不确定是否有任何本机winforms控件支持开箱即用的触摸事件,windows会将它们转换为等效的鼠标事件,因此您将无法使用触摸屏执行鼠标无法执行的任何操作。在本机浏览器中运行的网站将运行良好,因为浏览器支持触摸。感谢Ben、Pinch、zoom和其他触摸事件。唯一不起作用的是阻力。你仍然认为没有办法让C#web容器允许在Windows 8.1上进行侧扫吗?我不确定tbh,我怀疑触摸事件正在转化为等效的鼠标和键盘事件,而左键单击和拖动是“等效的”鼠标操作。
namespace WindowsFormsApplication1
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.webBrowser1 = new System.Windows.Forms.WebBrowser();
            this.SuspendLayout();
            // 
            // webBrowser1
            // 
            this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.webBrowser1.Location = new System.Drawing.Point(0, 0);
            this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
            this.webBrowser1.Name = "webBrowser1";
            this.webBrowser1.ScrollBarsEnabled = false;
            this.webBrowser1.Size = new System.Drawing.Size(2419, 1088);
            this.webBrowser1.TabIndex = 0;
            this.webBrowser1.Url = new System.Uri("https://beta.slimcrm.com/sideScrollTest.html", System.UriKind.Absolute);
            this.webBrowser1.AllowNavigation = false;
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(16F, 31F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(2419, 1088);
            this.Controls.Add(this.webBrowser1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.WebBrowser webBrowser1;
    }
}