marian_iliescu

Hi Forum.

I have a form where a control show an random images stored in MS SQL 2005 tables. The images is random from two tables. The problem is to zoom the image when the user is clicked on an image. Of course, the image has to be right choose.

Thank you for help.




Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

VBVB66

I don't exactly get what you are trying to ask but I think you want to make an image larger when it is clicked. If that is the case then all you have to do is resize the picturebox. (eg. PictureBox1.Width = 200) Let me know if that was not what you were asking.





Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

marian_iliescu

Thank you for reply.

Ok, you right, it's confused. What I try to do is to catch the id of the picture that is aleator choosed.

1st step: on form is rolling up some pictures readed from db;

2nd step: user click on one picture;

3rd: catch the id of the choosen picture; (the images are taken from db)

4th: perform some task (i.e. resize, ...).

Any suggestion is appreciated.






Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

VBVB66

To find if it matches a certain pic:
If PictureBox1.Image = {The image you want to compare it to in your db} Then
'Do something
End if





Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

marian_iliescu

Perhaps a loop statment can complete my ask when I wish to compare with the records from db.

But the first my problem is to identify correct the image that is rooling up...

Still open for suggestions...

Thank you 'VBVB66' for assistance.






Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

ReneeC

I don't think that VBS suggestion was a good one. Let's consider this. You are showing images and therefore these images must have pictureboxes to display them.

When loading the pictureboxes. store needed relational data in picturebox.tag. Then someone selects a picturebox, you extract the descriptive relational data relevant to the database for image retrieval.






Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

VBVB66

Wow, I was just thinking about using tag. When you set the picture use this: (Let's say the name of this pic is "Plop")
PictureBox1.Image = {Path to "Plop"}
PictureBox1.Tag = "Plop"





Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

marian_iliescu

Thanks a lot Renee. You guess my ask...

I will try to use the <tag> to solve my problem.

Respect.






Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

marian_iliescu

Thank you again 'VBVB66' for assistance.






Re: Visual Basic Express Edition How to capture the id of image when a event click mouse is fire?

ReneeC

"PictureBox1.Tag = "Plop""

Depending on the size of the database, the relational data is more likely to have a tablename if there is more than one and a key. Not usually an image name. If it's a simple database and the table is always the same, a row identifier would suffice, assuming the clumn is always the same.