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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image in UserControl

Status
Not open for further replies.

tm8747a

Programmer
Jun 30, 2005
1
BR
I've created a simple control that has two buttons on it. But then I wanted to use some images instead of graphics, which would dynamically change depending on some conditions. So I used some PictureBox controls and then created some Image objects using the Image.FromFile(String filename) method. I then can change the image in the PictureBox doing pictureBox1.Image = imgObject. This works fine when I use it in a windows application, inheriting from System.Windows.Forms.Form. But when I inherit System.Windows.Forms.UserControl and try to display things on a web page using the <OBJECT> tag, it does not display properly. After some tests, I noticed that the control cannot display the moment any Image.FromFile(String filename) method is used. Any solution to this problem? Any way to get this working or alternative way to accomplish what I want?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top