Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Winforms 拖动无边框cef winform_Winforms_Mouse_Cefsharp - Fatal编程技术网

Winforms 拖动无边框cef winform

Winforms 拖动无边框cef winform,winforms,mouse,cefsharp,Winforms,Mouse,Cefsharp,问题 我需要调整无边框表单的大小,但是当ChromiumWebBrowser的dock被填充时,CEF将吃掉与鼠标相关的信息,拖动表单变得非常不敏感 我观察了谷歌Chrome,当鼠标在表单外拖动可以改变表单大小时,我如何才能达到与谷歌Chrome相同的效果 更新 我需要拖动来改变表单的大小,还有很多私有代码,我不知道如何实现它。例如,ChromeWidgetMessageInterceptor.SetupLoop,在cefsharp源代码中,ChromeWidgetMessageIntercep

问题

我需要调整无边框表单的大小,但是当ChromiumWebBrowser的dock被填充时,CEF将吃掉与鼠标相关的信息,拖动表单变得非常不敏感

我观察了谷歌Chrome,当鼠标在表单外拖动可以改变表单大小时,我如何才能达到与谷歌Chrome相同的效果

更新

我需要拖动来改变表单的大小,还有很多私有代码,我不知道如何实现它。例如,ChromeWidgetMessageInterceptor.SetupLoop,在cefsharp源代码中,ChromeWidgetMessageInterceptor没有SetupLoop

更新2添加屏幕截图和代码

const int WM_MOUSEMOVE = 0x0200;
const int WM_MOUSELEAVE = 0x02A3;
const int WM_LBUTTONDOWN = 0x0201;
//
switch (message.Msg)
{
    case WM_MOUSEMOVE:
        var clientCursorPos = GetMousePoint(MousePosition);
        var newE = new MouseEventArgs(MouseButtons.None, 0, clientCursorPos.X, clientCursorPos.Y, 0);
        this.InvokeOnParent(delegate { this.OnMouseMove(newE); });
        break;
    case WM_LBUTTONDOWN:
        if (Cursor != Cursors.Default)
        {
            //this.InvokeOnParent(delegate { this.ResizeForm(this.ResizeDir); });
            this.InvokeOnParent(delegate
            {
                if (DesignMode) return;
                var dir = -1;
                switch (this.ResizeDir)
                {
                    case ResizeDirection.BottomLeft:
                        dir = HTBOTTOMLEFT;
                        break;
                    case ResizeDirection.Left:
                        dir = HTLEFT;
                        break;
                    case ResizeDirection.Right:
                        dir = HTRIGHT;
                        break;
                    case ResizeDirection.BottomRight:
                        dir = HTBOTTOMRIGHT;
                        break;
                    case ResizeDirection.Bottom:
                        dir = HTBOTTOM;
                        break;
                }

                ReleaseCapture();
                if (dir != -1)
                {
                    SendMessage(Handle, WM_NCLBUTTONDOWN, dir, 0);
                }
            });
        }
        break;
    case WM_MOUSELEAVE:
        Console.WriteLine("WM_MOUSELEAVE");
        break;
}
鼠标拖动以更改问题的大小


可能重复的只是搜索源代码,看看它是如何使用的。请看@amaitland,我看到了如何尝试ChromeWidgetMessageInterceptor,它在我自己的代码中实现。但还有一个问题,当我用鼠标拖动表单时,鼠标仍在响应浏览器控件。我能告诉你browser controlbu对拖动大小的更改没有反应吗?我不知道你在说什么mean@amaitland,我添加了截图和代码