コード例 #1
0
        private void newCoinToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormCoinView childForm = new FormCoinView();

            childForm.MdiParent = this;
            childForm.Show();
        }
コード例 #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter = "Coin or Bill file (*.coi;*.bil)|*.coi;*.bil|Coin file(*.coi) | *.coi | Bill file(*.bil) | *.bil";
            openFileDialog1.Title  = "Open a Coin or Bill File";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                if (System.IO.Path.GetExtension(openFileDialog1.FileName) == ".coi")
                {
                    FormCoinView childForm = new FormCoinView(this,
                                                              openFileDialog1.FileName);
                    if (childForm.FileName == null)
                    {
                        childForm.Dispose();
                    }
                    else
                    {
                        childForm.Show();
                    }
                }
                else if (System.IO.Path.GetExtension(openFileDialog1.FileName) == ".bil")
                {
                    FormBillView childForm = new FormBillView(this,
                                                              openFileDialog1.FileName);
                    if (childForm.Filename == null)
                    {
                        childForm.Dispose();
                    }
                    else
                    {
                        childForm.Show();
                    }
                }
            }
        }