예제 #1
0
 /// <summary>
 /// Handles the GotFocus event of the Form control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void Form_GotFocus(object sender, EventArgs e)
 {
     if (CefBrowser != null)
     {
         CefUtility.ExecuteTask(CefThreadId.UI, () =>
         {
             CefBrowser.GetHost().SetFocus(true);
         });
     }
 }
예제 #2
0
 /// <summary>
 /// Handles the Move event of the Form control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void Form_Move(object sender, EventArgs e)
 {
     if (CefBrowser != null)
     {
         CefUtility.ExecuteTask(CefThreadId.UI, () =>
         {
             CefBrowser.GetHost().NotifyMoveOrResizeStarted();
         });
     }
 }
예제 #3
0
파일: Window.cs 프로젝트: ulkyome/HtmlUi
        /// <summary>
        /// Handles the Resize event of the Window control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void Window_Resize(object sender, EventArgs e)
        {
            if (CefBrowser != null)
            {
                CefUtility.ExecuteTask(CefThreadId.UI, () =>
                {
                    var display = NativeMethods.get_xdisplay();

                    if (Form.WindowState != FormWindowState.Minimized)
                    {
                        // resize the browser
                        NativeMethods.XResizeWindow(display, CefBrowser.GetHost().GetWindowHandle(), (uint)Form.ClientSize.Width, (uint)Form.ClientSize.Height);
                    }
                });
            }
        }