Gtk.FileChooserDialog Class
Gtk.FileChooserDialog is a dialog box suitable for use with "File/Open" or "File/Save as" commands. This widget works by putting a Gtk.FileChooserWidget inside a Gtk.Dialog. It exposes the Gtk.FileChooser interface, so you can use all of the Gtk.FileChooser functions on the file chooser dialog as well as those for Gtk.Dialog.

See Also: FileChooserDialog Members

Syntax

public class FileChooserDialog : Dialog, FileChooser

Remarks

Similar to Gtk.FileChooserWidget but in a dialog.

Typical usage. In the simplest of cases, you can use the following code to select a file for opening:

C# Example

public class MainWindow: Gtk.Window {
	
	protected virtual void OnBtnLoadFileClicked(object sender, System.EventArgs e)
	{
		Gtk.FileChooserDialog fc=
		new Gtk.FileChooserDialog("Choose the file to open",
		                            this,
		                            FileChooserAction.Open,
		                            "Cancel",ResponseType.Cancel,
		                            "Open",ResponseType.Accept);

		if (fc.Run() == (int)ResponseType.Accept) 
		{
			System.IO.FileStream file=System.IO.File.OpenRead(fc.Filename);
			file.Close();
		}
		//Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
		fc.Destroy();
	}
  

Requirements

Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)
Assembly Versions: 2.12.0.0
Since: Gtk# 2.4