Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If this is the wrong forum please transfer to the correct forum. I am using C#.NET and I need to create a picturebox control with columns and row, such that I can assign a value (data type , int) to each cell . Please how can I do this?
The picture box would load an image but should be “sensitive” enough to know when the mouse hovers any cell.

C++
Ok. Whatever the control you recommend, please can you give some sample code? Can someone give some sample code for whatever control you think is appropriate for this
Posted
Updated 6-Jul-10 18:40pm
v2
Comments
PSK_ 2-Jul-10 1:34am    
Why are you not using TableLayoutPanel of a GridView control for this?
Shani Natav 2-Jul-10 1:34am    
What platform are you using? (Winforms, webforms, silverlight, WPF, etc...)

This is a new one. A lot of people want a picture box to do stupid things, but this takes the cake. A picture box shows a picture. USe a grid of some sort, or write your own control, a picture box will not help you here.
 
Share this answer
 
C++
Please allow me to offer more clarification:
The picture box control is expected to load an image. This image is actually a map (saved as a *.jpeg file) and it should be divided into cells (hence the need for the columns and rows). Each cell is assigned a value (the weight) which is a consequent of the prevailing condition at that area (topography).

If you recommend a "TableLayoutPanel of a grid view ", please can I get some sample code? I need to be able to assign a "weight" to each cell.
 If a need to subclass the TableLayoutPanel kindly point me in the right direction.

The platform is   win forms.
Any idea?
 
Share this answer
 
Comments
Christian Graus 6-Jul-10 0:04am    
Why did you push 'answer' when this is not an answer ? Edit your post or comment.
ihe 7-Jul-10 0:37am    
Ok. whatever the control you recommend, please can you give some sample code?
You're still asking a picture box to do stuff it has no idea how to do, and making it likely that it's harder for you to do it, b/c you can't work out how a picture box resizes a picture. Using a grid, you'd have to break your jpeg up in to cells. I'd still be inclined to just paint your picture on the form, and work out your columns and rows in code, esp if they are all the same size.
 
Share this answer
 

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