Is there anyway to create an image box during runtime through a button or code?
Either a no or explanation would be very useful.
Thanks in advance.
Odracir123.
Printable View
Is there anyway to create an image box during runtime through a button or code?
Either a no or explanation would be very useful.
Thanks in advance.
Odracir123.
There two ways (only) to create new control ar runtime in VB6:
- using control array (group of controls sharing the same name but having unique indexes)
- using Controls collection
Method 1: control array:
- create one image control in design mode and change its Index property to 0 (zero)
during runtime use similar code (button click lot form_load or whatever):
Method 2 - controls collection:Code:Load Image1(Image1.Ubound +1)
Image1(Image1.Ubound).Move SomeLeft, someTop
Set Image1(Image1.Ubound).Picture = LoadPicture("full path goes here")
Image1(Image1.Ubound).Visible = True
Code:Dim img As Image
Set img = Me.Controls.Add("VB.Image", "imgNew")
Set img.Picture = LoadPicture("full path goes here")
img.Move SomeLeft, someTop
img.Visible = True
Check this link http://www.vbforums.com/showthread.p...ading+imagebox
Hey rhinbobull the link i posted is same what u wrote. it was also posted by u.
Thank you so much. You have no idea how long I've been looking for this.
Thanks again, Odracir123.
You're welcome.