This property sets the file type initially displayed by the OpenFileDialog and SaveFileDialog methods.

[Visual Basic] Public Property FileExtension As String
[C#] public string FileExtension {get; set;}

Property Value

The FileExtension is the file type (i.e. jpg, bmp)

Explanation

The FileExtension property sets the file type initially displayed by the OpenFileDialog and SaveFileDialog methods. When you execute the OpenFileDialog and SaveFileDialog methods, the "Open" dialog box and "Save" dialog box will be displayed. The FileExtension property sets which file extentions will be listed in the "Files of type" drop down menu at the bottom of the dialog box.

By default the "Open" dialog box and the "Save" dialog box display all file types in a given folder. They also display the term "All Files" along with all individual file extentions supported by the ImageKit in the "Files of type" drop down menu at the bottom of the dialog box. By setting the FileExtension property, you can determine which file extentions will be listed in this drop down menu and thereby influence the types of files that can be selected in the "Open" dialog box and "Save" dialog box.

To set the FileExtension property, start with the file explanation followed by a "|" symbol as a delimeter and the the file extensions to be displayed. When listing multiple file extensions, use a comma (;) to delimit them. If an empty string ("") is set into the FileExtension property then the file types will be "all files". If an empty string is set into the FilePath property, then the current directory will be displayed when the dialog opens.

There is no distinction made between upper case or lower case letters so that "BMP" is treated as the same as "bmp".

Example

The code below illustrates how to set the default folder to "C:\Images" and to set the file types to "BMP", "JPG and PNG", and "All Files":

[Visual Basic.NET]
ImageKit1.File.FilePath = "c:\images"
ImageKit1.File.FileExtension = "Bitmap files|.bmp;Jpeg,Png files|.jpg;*.png; All Files|*.*"

[Visual C#.NET] 
ImageKit1.File.FilePath = "c:\\Images";
ImageKit1.File.FileExtension = "Bitmap files|.bmp;Jpeg,Png files|.jpg;*.png; All Files|*.*";

See Also

ImageKit.File Members | Newtone.ImageKit.Wpf.ImageKit

The ImageKit WPF is created by Newtone Corporation