Creating Controls at Runtime

junkste
04-15-2003, 03:08 PM
Hello!

I have a form which contains a picture box, and a label contained in the picture box. Both the picture box and the label are set as elements of a control array so that I can create more of them at runtime. The problem is, the labels are created in the original picture box, but I need them in the new picture box. Does anyone know how to either create the labels in the new picture box OR move them into it after they've been created (I've already tried lblLabel.Container = picPictureBox but it doesn't seem to work). :confused:

Thanks,

Ste

OnErr0r
04-15-2003, 03:27 PM
Load a new picturebox array item
Load a new label array item

Set Label(index).Container = Picture(index)

Move them where you want, then make them visible.

junkste
04-16-2003, 07:47 AM
D'oh, I was forgetting about the picturebox index :chuckle: I'll give that a go. Thanks :rolleyes:

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum