Click here to Skip to main content
15,891,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to create instance of lines for each instances of picturebox?
If so, can anyone please provide some guidelines?

Thanks. :)
Posted
Updated 4-Jan-11 19:09pm
v2
Comments
dmageiras 5-Jan-11 1:09am    
What do you mean by instances of lines?
yummy02 5-Jan-11 1:22am    
I want to add lines outside picturebox. Since the occurrence of my picture boxes is per instance, I want to draw lines in all instances of pictureboxes. I think, lines can be make through instances too.
Khaniya 5-Jan-11 1:27am    
How to create instance of lines in c#?
Not very clear with your question so
thanks

1 solution

Each picturebox instance has an origin, width and height that are known (or knowable). If the picturebox is a container that supports graphics objects, you should be able to draw your lines directly in the container. If not, you'll have to draw them relative to the origin of the container that hosts the picturebox, using the origin coordinates of the picturebox as an offset.

I haven't tried drawing over a picture, and don't have any plans to do so, but it should only take a couple of hours of playing with different approaches to find out what works. Spend the time, then post some of the code you've tried and descriptions of the results. That will get you much better answers here.

Good luck!
 
Share this answer
 
Comments
yummy02 5-Jan-11 5:06am    
Hi,

What I'm trying to ask is that I want to draw lines that will connect two or more picture boxes. I can't draw lines. I just can draw one line even though I have 5 picture boxes. All picture boxes are loaded by means reading a file. It means to say that if the file has 5 picture boxes, the app will load all 5 make lines that will connect each picture box. I don't know if that's possible.he he Thanks. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900