TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
axb924
NA
30
0
Adding a Picturebox
Jun 14 2004 11:34 PM
I have a class in which I dynamically create a picturebox and atrribute an image to it. Then i want to have it added to my form, but I can't use the this pointer, instead i declared an instance of the form class in which I want to add the picturebox, but I keep getting an error runtime called 'System.StackOverflowException'. Can someone please help. public class ElectricalComponent { Form1 hello = new Form1(); public void Instance(Point p) { PictureBox Temp = new PictureBox(); string path = @"C:\AG00103.GIF"; Temp.Location = new Point(p.X, p.Y); Temp.Size = new Size (100, 100); Temp.SizeMode = PictureBoxSizeMode.StretchImage; Temp.Image = Image.FromFile (path); hello.Controls.Add(Temp); } }
Reply
Answers (
0
)
.:Menu:.
Converting TextBox values to Numeric Values