Exemplo n.º 1
0
        // this should only be executed once per Form
        public static API_WebScarab syncGuiPositionWithControl(this API_WebScarab webScarab, Control control)
        {
            Action moveToControl =
                () => {
                webScarab.alwaysOnTop(true);
                var xPos   = control.PointToScreen(System.Drawing.Point.Empty).X;
                var yPos   = control.PointToScreen(System.Drawing.Point.Empty).Y;
                var width  = control.width();
                var height = control.height();
                webScarab.moveWindow(xPos, yPos, width, height);
            };

            control.parentForm().Move +=
                (sender, e) => moveToControl();

            control.Resize +=
                (sender, e) => moveToControl();
            moveToControl();
            return(webScarab);
        }
Exemplo n.º 2
0
 public static API_WebScarab alwaysOnTop(this API_WebScarab webScarab)
 {
     return(webScarab.alwaysOnTop(true));
 }