상속: System.Windows.Forms.Form
예제 #1
0
파일: MainForm.cs 프로젝트: Venseer/tools
        private void resizeToolStripMenuItem_Click(object sender, EventArgs args)
        {
            SizeForm form = new SizeForm(map.Width, map.Height);

            form.ShowDialogCenter(this);
            if (!form.OK)
            {
                return;
            }

            int n = form.N;
            int e = form.E;
            int s = form.S;
            int w = form.W;

            if (-n >= Height || -s >= Height || -e >= Width || -w >= Width ||
                -(n + s) >= Height || -(e + w) >= Width)
            {
                ErrorBox("The parameters you provided make it impossible to resize the map.",
                         "Invalid parameters!");
            }

            map.Resize(n, e, s, w);
        }
예제 #2
0
        private void resizeToolStripMenuItem_Click(object sender, EventArgs args)
        {
            SizeForm form = new SizeForm(map.Width, map.Height);
            form.ShowDialogCenter(this);
            if (!form.OK) return;

            int n = form.N;
            int e = form.E;
            int s = form.S;
            int w = form.W;

            if(-n >= Height || -s >= Height || -e >= Width || -w >= Width ||
                -(n+s) >= Height || -(e+w) >= Width)
            {
                ErrorBox("The parameters you provided make it impossible to resize the map.",
                    "Invalid parameters!");
            }

            map.Resize(n, e, s, w);
        }