If you want to put the code in a separate dll, follow these steps:
- In your solution, add a new class library project to create your DLL
- In this newly created project, add a link to
System.Windows.Forms - Add customization code to the
OpenFileDialogclass library project - Windows Forms ()
, , , , DLL. :
class SpecializedOpenFileDialog
{
private OpenFileDialog ofd = new OpenFileDialog();
public SpecializedOpenFileDialog()
{
ofd.Multiselect = false;
ofd.Filter = "*.html";
}
public DialogResult ShowDialog()
{
return ofd.ShowDialog();
}
public string FileName
{
get
{
return ofd.FileName;
}
}
}