Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

openFileDialog1is a field but is used like a type

Status
Not open for further replies.

Saturn57

Programmer
Aug 30, 2007
275
CA
Why am I getting this error?

private void attachBN_Click(object sender, System.EventArgs e)
{

try
{

openFileDialog1 open = new OpenFileDialog();

open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";

if (open.ShowDialog() == DialogResult.OK)
{

pictureBox1.Image = new Bitmap(open.FileName);

}

}

catch (Exception)
{

throw new ApplicationException("Failed loading image");

}

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top