Simple Open file dialog : OpenFileDialog « GUI Windows Forms « C# / CSharp Tutorial






Simple Open file dialog
using System;
using System.Drawing;
using System.Windows.Forms;

public class OpenFileDialogTest{

  public static void Main()
  {
    OpenFileDialog dlg=new OpenFileDialog();

    if(dlg.ShowDialog() == DialogResult.OK)
    {
      MessageBox.Show("You selected the file "+dlg.FileName);
    }
  }

}








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