Exemplo n.º 1
0
        private void поискХолодильникаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int find = 0;

            for (int i = 0; i < MdiChildren.Length; i++)
            {
                if (MdiChildren[i] is FridgeFind)
                {
                    find++;
                }
            }
            if (find > 0)
            {
                return;
            }
            FridgeFind f = new FridgeFind();

            f.MdiParent = this;
            f.Show();
            relocateWindows();
        }
Exemplo n.º 2
0
        public void relocateWindows()
        {
            FridgeEdit edit = null;
            FridgeFind find = null;

            foreach (Form f in MdiChildren)
            {
                if (f is FridgeFind)
                {
                    find = (FridgeFind)f;
                }
                if (f is FridgeEdit)
                {
                    edit = (FridgeEdit)f;
                }
            }
            if (edit == null && find == null)
            {
                return;
            }
            else
            if (edit != null && find == null)
            {
                edit.Location = new Point(0, 0);
            }
            else
            if (edit == null && find != null)
            {
                find.Location = new Point(0, 0);
            }
            else
            {
                edit.Location = new Point(0, 0);
                find.Location = new Point(edit.Width, 0);
                find.Width    = Width - edit.Width - 20;
                find.Height   = Height - 67;
            }
        }