void IPlatformWindowBox.SetLocation(int x, int y) { //invoke Before accept new location PreviewBoundChanged?.Invoke(this, EventArgs.Empty); //------------------ _formLocalX = x; _formLocalY = y; //Console.WriteLine("set location " + x + "," + y); // if (this.UseRelativeLocationToParent) { if (!_evalLocationRelativeToDesktop) { _locationRelToDesktop = new System.Drawing.Point(); if (_form.LinkedParentControl != null) { //get location of this control relative to desktop _locationRelToDesktop = _form.LinkedParentControl.PointToScreen(System.Drawing.Point.Empty);//** } _evalLocationRelativeToDesktop = true; } _form.Location = new System.Drawing.Point( _locationRelToDesktop.X + x, _locationRelToDesktop.Y + y); } else { _form.Location = new System.Drawing.Point(x, y); } BoundsChanged?.Invoke(this, EventArgs.Empty); }
void IPlatformWindowBox.SetSize(int w, int h) { PreviewBoundChanged?.Invoke(this, EventArgs.Empty); _form.Size = new System.Drawing.Size(w, h); BoundsChanged?.Invoke(this, EventArgs.Empty); }