|
-
Sep 9th, 2008, 05:48 PM
#1
Thread Starter
New Member
Moving controls into Picturebox
VB5: How do I move a textbox and a command button into a picturebox.
Also, can I duplicate the picturebox, including these controls?
THANK YOU !!!!
-
Sep 9th, 2008, 06:03 PM
#2
Re: Moving controls into Picturebox
 Originally Posted by DennisTheVB
VB5: How do I move a textbox and a command button into a picturebox.
Not sure about VB5 but in VB6 you can set the objects .Container property....
Code:
Private Sub Command1_Click()
Set Text1.Container = Picture1 ' Put Text1 into Picture1
Text1.Move 10,10 ' move to position 10,10
Set Command1.Container = Picture1
Command1.Move Text1.Width + 100, 10
End Sub
-
Sep 9th, 2008, 06:17 PM
#3
Thread Starter
New Member
Re: Moving controls into Picturebox
Thank you, thank you and thank you again !!!
-
Sep 10th, 2008, 12:01 AM
#4
Member
Re: Moving controls into Picturebox
Very nice code 
Do you know how to do it with another form becuase I tried but I got an error?
-
Sep 10th, 2008, 04:27 AM
#5
Re: Moving controls into Picturebox
 Originally Posted by MongooseRoadkill
Very nice code
Do you know how to do it with another form becuase I tried but I got an error?
I don't think VB has a built in function to do that, you probably need to use the SetParent API.
I think this example does that, Reparent controls from one form to another.
-
Sep 10th, 2008, 04:59 AM
#6
Member
Re: Moving controls into Picturebox
I've got it working now thanks
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
|