Hi there,

Is there a way in vb2005 to:

passtrough the name of a control to an other sub? I have 5 pictureboxes.
I want to do some action in the other sub, depending on what control has been clicked on.

example:

Private sub Picture1_Click()

dim objControlName as Picturebox

objControlname = Picturebox1

ActionOnClick(objControlName)

end sub


Private sub ActionOnClick(objControlName)

if objControlName.image=("C:\.........\image1.bmp) then
action
endif


I can't figure out how to handle this one...

Please Help..

Thanks ...

Grtz,
Nokkieja
end sub

Recommended Answers

All 2 Replies

Hi,

Am sorry to inform you that you can't get the image name or path after being embedded in the picture box. In order to over come this place the file name in the tag of each picturebox. And then you will be able to compare the picturebox tag to the file source.

Thanx for your answer,

but i need to do more things with the control name.
So i actualy need to know how i can use the properties of a control when clicked and in an other sub than the click event.

grtz

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.