In addition to referencing the proper assemblies (here... it's linked from the main page of clearcanvas.ca) I mentioned in a comment, consider employing the using
keyword since OpenFileDialog
implements IDisposable
like so:
using(OpenFileDialog ofd = new OpenFileDialog())
{
ofd.Filter = "DICOM Files(*.*)|*.*";
if (ofd.ShowDialog() == DialogResult.OK)
{
// rest of your code goes here
}
}
This has the benefit of calling ofd.Dispose()
automatically, even if the code inside the using
block throws an exception. This works for anything that implements IDisposable
(so bitmaps, fonts, streams, etc.)