Exemplo n.º 1
0
        private void CreateFormToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Int32 count = this.MdiChildren.Count();

            СhildForm childForm = new СhildForm();

            childForm.Text      = "Форма " + count;
            childForm.MdiParent = this;
            childForm.Show();
        }
Exemplo n.º 2
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            _pathToFileState = System.IO.Directory.GetCurrentDirectory() + "\\state.txt";

            if (File.Exists(_pathToFileState))
            {
                _listState = LoadStateList();

                foreach (DTOState state in _listState)
                {
                    СhildForm childForm = new СhildForm();

                    childForm.StartPosition = FormStartPosition.Manual;
                    childForm.Location      = state.Location;
                    childForm.MdiParent     = this;
                    childForm.Size          = state.Size;
                    childForm.Show();

                    string title = $"Форма {state.Index} [Координаты: {state.Location.ToString()}] [Размеры: {state.Size.ToString()}]";

                    childForm.Text = title;
                }
            }
        }