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

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

Property Value

The FilePath is the folder name

Explanation

The FilePath property sets the folder 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 FilePath property allows you to set the folder that is accessed when the "Open" dialog box and "Save" dialog box are displayed.

When setting 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 direct 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 illustlates 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] Dim Ik_File

As Newtone.ImageKit.IkFile Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
  Handles MyBase.Load Ik_File =
New Newtone.ImageKit.IkFile

End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  Handles Button1.Click Dim fname

  As String Ik_File.FilePath
  = "c:\images" Ik_File.FileExtension = "Bitmap Files|*.bmp|Jpeg,Png Files|*.jpg;*.png|All
  Files|*.*" fname =
  Ik_File.OpenFileDialog() PictureBox1.Image = New
Bitmap(fname) End

Sub [Visual
C#.NET] private Newtone.ImageKit.IkFile

Ik_File; private void Form1_Load(object sender, System.EventArgs
e)
  { Ik_File = new
Newtone.ImageKit.IkFile();

} private void button1_Click(object sender, System.EventArgs
e)
  { Ik_File.FilePath =
  "c:\\Images"; Ik_File.FileExtension = "Bitmap Files|*.bmp|Jpeg,Png Files|*.jpg;*.png|All Files|*.*";
  string fname = Ik_File.OpenFileDialog();
  pictureBox1.Image = new Bitmap(fname);
}

See Also

IkFile Class | IkFile Members

The ImageKit.NET3 is created by Newtone Corporation