views:

148

answers:

1

Using C#.Net

On my form i have a button that opens a dialog which allows a customer to select a picture, when the ok button is clicked the picture should be visible in the ultrapicture box control on the form..Not sure how to achieve this or if its simple a property to be set, any ideas ?

+6  A: 

Something like this:

DialogResult dr = openFileDialog1.ShowDialog();
if ( dr == DialogResult.OK )
{
      Image pic = Image.FromFile( openFileDialog1.FileName );
      pictureBox1.Image = pic;
}

Guessing that "ultrapicture box control" is a System.Windows.Forms.PictureBox descendant.

Tamás Szelei
I would guess that it is the Infragistics UltraPictureBox control, but it should still be the Image property, and your code sample should still be valid.
Fredrik Mörk