|
-
Aug 20th, 2012, 12:46 AM
#1
Thread Starter
Member
Add a shape to a picture box at run time
I am trying to add a circle to a picture box at run time.
I tried the following , but I see no shape
Dim Shape5 As Shape
Set Shape5 = Controls.Add("vb.shape", "Myshape", Me)
Shape5.BackStyle = 1
Shape5.BackColor = vbRed
The picture box is named "Pbox2"
Thanks for your help
-
Aug 20th, 2012, 01:20 AM
#2
Re: Add a shape to a picture box at run time
Your shape is not visible
Code:
Shape5.Visible = True
-
Aug 20th, 2012, 01:21 AM
#3
Re: Add a shape to a picture box at run time
Double post for some reason?
-
Aug 20th, 2012, 02:31 AM
#4
Frenzied Member
Re: Add a shape to a picture box at run time
I am trying to add a circle to a picture box at run time.
I tried the following , but I see no shape
Try the following ! .
Code:
Dim Shape5 As Shape
Set Shape5 = Controls.Add("vb.shape", "Myshape", Me)
shap5.visible=true
Shape5.BackStyle = 1
Shape5.BackColor = vbRed
-
Aug 20th, 2012, 10:36 AM
#5
Re: Add a shape to a picture box at run time
Also if you want it inside picturebox do this
Code:
Set Shape5.Container = PBox2
-
Aug 20th, 2012, 11:27 AM
#6
Frenzied Member
Re: Add a shape to a picture box at run time
Yes Max187Boucher suggestion .i will also recommend .
Code:
Dim Shape5 As Shape
Set Shape5 = Controls.Add("vb.shape", "Myshape", Me)
Set Shape5.Container = PBox2
shap5.visible=true
Shape5.BackStyle = 1
Shape5.BackColor = vbRed
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
|