Ejemplo n.º 1
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QuoteManagerForm quoteForm = new QuoteManagerForm();

            quoteForm.MdiParent = this;
            Panel1.Controls.Add(quoteForm);
            quoteForm.Show();
            quoteForm.BringToFront();
            if (Panel1.Controls.Count == 1)
            {
                quoteForm.Dock = DockStyle.Fill;
            }
            else
            {
                int count  = Panel1.Controls.Count;
                int height = Panel1.Height / count;
                int width  = Panel1.Width;

                for (int i = 0; i < count; i++)
                {
                    Panel1.Controls[i].Dock     = DockStyle.None;
                    Panel1.Controls[i].Location = new Point(0, i * height);
                    Panel1.Controls[i].Height   = height;
                    Panel1.Controls[i].Width    = width;
                }
            }
        }
Ejemplo n.º 2
0
 private void closeAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.ActiveMdiChild.Name == "StarsViewerForm")
         {
             DetailForm starsViewer = (DetailForm)this.ActiveMdiChild;
             starsViewer.Close();
         }
         else
         {
             QuoteManagerForm objfrmSChild = (QuoteManagerForm)this.ActiveMdiChild;
             objfrmSChild.Close();
         }
     }
     catch
     {
     }
 }