|
-
May 31st, 2006, 09:30 PM
#1
Is it possible to create Pictureboxes during run time?
Hi,
Is it possible to create Pictureboxes during run time?
During design time, there is only 1 picturebox on the form but when the application is running, I would like to add more pictureboxes 'on the fly'.
Can this be done in vb.net?
-
May 31st, 2006, 10:08 PM
#2
Re: Is it possible to create Pictureboxes during run time?
intialize new pictureBox object
Code:
dim newPictureBox as PictureBox
newPictureBox= new PictureBox()
set its properties
Code:
newPictureBox.Parent=me
newPictureBox.Location=new Point(10,10)
newPictureBox.Size=new Size(100,100)
add it to parent controls
Code:
Me.Controls.Add(newPictureBox)
-
June 1st, 2006, 01:09 AM
#3
Re: Is it possible to create Pictureboxes during run time?
-
June 1st, 2006, 11:51 PM
#4
Re: Is it possible to create Pictureboxes during run time?
Thanks for the replies! 
And to remove controls during run time, the code will be:
Me.controls.remove(Picturebox1) right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|