예제 #1
0
		private void cmdOpen(object sender, EventArgs e)
		{
			OpenFileDialog dlgOpen = new OpenFileDialog();
			dlgOpen.InitialDirectory = lastDir;
			dlgOpen.Filter = "Order Files (*.ord)|*.ord";

			// Show the open dialog.
			if (dlgOpen.ShowDialog() == DialogResult.OK)
			{
				Order doc = new Order();

				try
				{
					doc.Open(dlgOpen.FileName);
				}
				catch (Exception err)
				{
					// All exceptions bubble up to this level.
					MessageBox.Show(err.ToString());
					return;
				}

				// Create the child form for the selected file.
				Child frmChild = new Child(doc, Child.ViewType.ItemGrid);
				frmChild.MdiParent = this;
				frmChild.Show();
			}
		}
예제 #2
0
		public void Open()
		{
			OpenFileDialog dlgOpen = new OpenFileDialog();
			dlgOpen.InitialDirectory = lastDir;
			dlgOpen.Filter = "Order Files (*.ord)|*.ord";

			// Show the open dialog.
			if (dlgOpen.ShowDialog() == DialogResult.OK)
			{
				Order doc = new Order();

				try
				{
					doc.Open(dlgOpen.FileName);
				}
				catch (Exception err)
				{
					// All exceptions bubble up to this level.
					MessageBox.Show(err.ToString());
					return;
				}

				// Create the child form for the selected file.
				Child frmChild = new Child(doc, Child.ViewType.ItemGrid);
                Program.DocumentManager.AddForm(frmChild);
				frmChild.Show();
			}
		}
        private void cmdOpen(object sender, EventArgs e)
        {
            OpenFileDialog dlgOpen = new OpenFileDialog();

            dlgOpen.InitialDirectory = lastDir;
            dlgOpen.Filter           = "Order Files (*.ord)|*.ord";

            // Show the open dialog.
            if (dlgOpen.ShowDialog() == DialogResult.OK)
            {
                Order doc = new Order();

                try
                {
                    doc.Open(dlgOpen.FileName);
                }
                catch (Exception err)
                {
                    // All exceptions bubble up to this level.
                    MessageBox.Show(err.ToString());
                    return;
                }

                // Create the child form for the selected file.
                Child frmChild = new Child(doc, Child.ViewType.ItemGrid);
                frmChild.MdiParent = this;
                frmChild.Show();
            }
        }
예제 #4
0
        public void Open()
        {
            OpenFileDialog dlgOpen = new OpenFileDialog();

            dlgOpen.InitialDirectory = lastDir;
            dlgOpen.Filter           = "Order Files (*.ord)|*.ord";

            // Show the open dialog.
            if (dlgOpen.ShowDialog() == DialogResult.OK)
            {
                Order doc = new Order();

                try
                {
                    doc.Open(dlgOpen.FileName);
                }
                catch (Exception err)
                {
                    // All exceptions bubble up to this level.
                    MessageBox.Show(err.ToString());
                    return;
                }

                // Create the child form for the selected file.
                Child frmChild = new Child(doc, Child.ViewType.ItemGrid);
                Program.DocumentManager.AddForm(frmChild);
                frmChild.Show();
            }
        }