Click here to Skip to main content
15,895,799 members

picture box Image loading problem

Revision 3
I have a winform on which I have tab control and I'm adding a picture box control to the tab page. I want to load an image to this picturebox control in the tab page. I'm adding the control to tab page is as follows:

C#
m_Canvas = new PhotoCanvas();
// initializing the picture box control
m_Canvas.BackColor = Color.White;m_Canvas.Width = 500;m_Canvas.Height = 400;m_Canvas.Left = 0;m_Canvas.Top = 0;this.MainTab.TabPages[0].Controls.Add(m_Canvas);
//adding the picture box control to tabpage


I have tried to load the image using

C#
if (m_OpenFileDialog.ShowDialog() == DialogResult.OK)
 {
     m_Canvas.Image = new Bitmap(m_OpenFileDialog.FileName);

 }


but it's not working please help.Thanks in advance
Posted 27-Mar-13 2:23am by Sreeju padmanabhan.
Tags: ,