Пример #1
0
        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();
                }
            }
        }