AddonHelper.FormDrag.FormDrag_MouseDown C# (CSharp) Méthode

FormDrag_MouseDown() private méthode

private FormDrag_MouseDown ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
Résultat void
        private void FormDrag_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left) {
                this.labelInstructions.Text = "Release to upload\nRight mouse button to cancel";

                this.ScreenBox.Visible = true;
                this.picWidth.Visible = true;
                this.picHeight.Visible = true;

                int X = e.X;
                int Y = e.Y;
                if (sender.GetType() == typeof(Label)) {
                    X += this.ScreenBox.Left;
                    Y += this.ScreenBox.Top;
                }

                this.StartX = X;
                this.StartY = Y;

                this.Selection = new Rectangle(e.X, e.Y, 1, 1);
                this.SetArea();

                this.timerSet.Enabled = true;
            } else if (e.Button == MouseButtons.Right && this.ScreenBox.Visible) {
                this.labelInstructions.Text = "Drag the mouse\nEscape to close";

                this.Selection = new Rectangle();

                this.ScreenBox.Visible = false;
                this.picWidth.Visible = false;
                this.picHeight.Visible = false;

                this.timerSet.Enabled = false;
            }
        }