renaming images

samresh
07-20-2003, 12:10 PM
i have placed an image control on a picturebox. The property for the image visible is set to false. Now with the help of a command button i am creating copis of thesame image.Thus what i get is an array of the images that are indexed. The problem is that i want to give specific Number to the image for it s identification and at teh same time want that the number given should be displayed alongwith the image.All this remember on a picturebox.
My email samresh_m@hotmail.com

GavinO
07-20-2003, 02:33 PM
The container in this case is basically irrelevant. The index property of the images will uniquely id each image control. As for the display, I don't understand; you said that the images were hidden?

PopStevo
07-20-2003, 04:04 PM
U could use the .Tag property for indexing. Or define an array / collection that when accessed by the image index gives / puts the index YOU want it to be

samresh
07-22-2003, 12:04 PM
what is required is that at the click of the command button i am making the copy of the image at the same time the copy made is set for its property as visible as a result every time the command button is pressed the copies of the same image are created now to differentiate between them or so to say to identify them it is reqd to rename them so that they are given say for example a specific number. so if you can help me please

passel
07-22-2003, 12:22 PM
i have placed an image control on a picturebox. The property for the image visible is set to false. Now with the help of a command button i am creating copis of thesame image.Thus what i get is an array of the images that are indexed. The problem is that i want to give specific Number to the image for it s identification and at teh same time want that the number given should be displayed alongwith the image.All this remember on a picturebox.
My email samresh_m@hotmail.com

Depending on your scale, and where your image boxes are displayed,
perhaps you can use something like this.

' if you just made image1(2) visible, and assuming your picturebox's
scaling is vbPixels, and that you have room to the left of your image,
you could:

Idx = 2
Picture1.CurrentX = image1(Idx).Left - 40
Picture1.CurrentY = image1(Idx).Top
Picture1.Print Idx

You may want to set the property Picture1.FontTransparent = False
so that characters erase the area underneath them when they print.

If you wanted to put the numbers underneath the images.

Idx = 2
Picture1.CurrentX = image1(Idx).Left + (Image1(Idx).Width/2)
Picture1.CurrentY = image1(Idx).Top + Image1(Idx).Height
Picture1.Print Idx

PopStevo
07-22-2003, 06:26 PM
if you want to make copies of any control, put the Index property of the first control to any. Then when you want to create another control, use the Load statement.
You just put
Load Control.Item(Index)
--or--
Load Control(Index)
and it will make another control in the place of the first one and invisible (property Visible to False).
If you make an image control named, say: imgMyImage. put its Index property (defaultly) to 0. then in code when you want to create another under the first:
Load imgMyImage.Item(1)
imgMyImage.Item(1).Top=imgMyImage.Item(0).Top+imgMyImage.Item(0).Heigh t
imgMyImage.Item(1).Visible=True
think that should do it

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum