private void conLength_Click(object sender, EventArgs e) { SetSizeForm sizeForm = new SetSizeForm(RulerLength, Settings); sizeForm.TopMost = this.TopMost; if (sizeForm.ShowDialog(this) == DialogResult.OK) { this.RulerLength = sizeForm.RulerLength; } }
private void conLength_Click(object sender, EventArgs e) { SetSizeForm sizeForm = new SetSizeForm(this.Size, Settings); sizeForm.TopMost = this.TopMost; if (sizeForm.ShowDialog(this) == DialogResult.OK) { int w = (int)Math.Round(sizeForm.RulerWidth); int h = (int)Math.Round(sizeForm.RulerHeight); // if both width and height are set, switch into 2d mode if (w > RestrictSize && h > RestrictSize) { ResizeMode = FormResizeMode.TwoDimensional; } this.Width = w; this.Height = h; } }