예제 #1
0
파일: MainForm.cs 프로젝트: areyram/cursos
        private void NewFile()
        {
            var form = new NoteForm
            {
                MdiParent = this,
                IsDirty   = false,
                FileName  = string.Empty
            };

            form.Show();
        }
예제 #2
0
파일: MainForm.cs 프로젝트: areyram/cursos
        private void OpenFile()
        {
            var openFileDialog = new OpenFileDialog
            {
                InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal),
                Filter           = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*",
                CheckFileExists  = true,
                Multiselect      = true
            };

            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                foreach (var fileName in openFileDialog.FileNames)
                {
                    var form = new NoteForm
                    {
                        MdiParent = this,
                        FileName  = fileName
                    };
                    form.LoadDocument();
                    form.Show();
                }
            }
        }