OpenFileDialog: browsing for a set of files : OpenFileDialog « GUI Windows Forms « C# / CSharp Tutorial






OpenFileDialog: browsing for a set of files
using System;
using System.Windows.Forms;

public class OpenFileDialogSetFiles
{
  public static void Main() 
  {
    OpenFileDialog dlgOpen = new OpenFileDialog();
    
    dlgOpen.Title = "Select one or more files";
    dlgOpen.ShowReadOnly = true;
    dlgOpen.Multiselect = true;

    if (dlgOpen.ShowDialog() == DialogResult.OK)
    {
      foreach (string s in dlgOpen.FileNames)
        Console.WriteLine(s);
    }
  }
}








23.45.OpenFileDialog
23.45.1.Simple Open file dialogSimple Open file dialog
23.45.2.OpenFileDialog Event: FileOkOpenFileDialog Event: FileOk
23.45.3.OpenFileDialog: browsing for a fileOpenFileDialog: browsing for a file
23.45.4.OpenFileDialog: browsing for a set of filesOpenFileDialog: browsing for a set of files
23.45.5.OpenFileDialog: filer, initial directory