Click here to Skip to main content
15,896,290 members
Please Sign up or sign in to vote.
1.11/5 (3 votes)
See more:
actually i have to develop win form.in this we have to use 7 picture box controls as routers .every

router has some nodes .randomly select a router then choose node for source and also choose another

router for receiving a file.another router also some nodes then choose any node for receiving a file.

nodes like as picture box also.

how to use picture box in switch case statement for taking a input.

pls help me
Posted
Updated 16-Sep-14 9:27am
v2
Comments
Dave Kreskowiak 16-Sep-14 15:28pm    
This made no sense at all. What's a "router"? What's a "node"? What do they have to do with PictureBoxes? How does this "file" fit into all of this??
Sergey Alexandrovich Kryukov 16-Sep-14 16:11pm    
Probably, it's something like graphical programming. I think the whole field is pretty stupid, but the particular idea to use PictureBox is just silly, shows misunderstanding of what's involved.
I tried to explain things in my answer.
—SA
Afzaal Ahmad Zeeshan 16-Sep-14 15:51pm    
Networking intermixed with the Programming? I like this one. :-)
Sergey Alexandrovich Kryukov 16-Sep-14 16:11pm    
Please see my comment above and my answer...
—SA
ZurdoDev 16-Sep-14 16:01pm    
What?

1 solution

It sounds like the picture box is a really bad candidate for the component you can use. Please see my past answers:
Append a picture within picturebox[^],
draw a rectangle in C#[^],
How do I clear a panel from old drawing[^].

What to do instead? I would probably advise something if the question was not so vague. Anyway, if you hope to combine some graphics with image fragments formed by the instances of PictureBox, it will give you a lot more troubles and no benefits at all. You really need to draw the whole scene as a whole graphical element. Images can be presented using Graphics.DrawImage or not used at all. The further detail depends on what exactly you want to achieve.

—SA
 
Share this answer
 
Comments
ZurdoDev 16-Sep-14 16:14pm    
Based on the title of the question "swicth case" makes me think he wants to have drag and drop and wants to do a switch statement on which picturebox was dropped. Something along those lines.
Sergey Alexandrovich Kryukov 16-Sep-14 16:18pm    
Yes, it could be that. Or a note on a graph is static, but represents the "if" operator (or something similar).
In all those cases, the key is not to use PictureBox but represent all graph in a single graphical object.
—SA
Afzaal Ahmad Zeeshan 16-Sep-14 16:28pm    
Actually, I like your idea of Graphics.DrawImage thing. That is a great thing, but again, how can those graphics raises events! -_-
Sergey Alexandrovich Kryukov 16-Sep-14 16:31pm    
This is not a problem at all. The events should be underlying control. It's still much easier (called "hittest") than using separate controls, especially such redundant controls as PictureBox.
—SA
Afzaal Ahmad Zeeshan 16-Sep-14 16:32pm    
Oh, amazing answer sir!

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