-
Jun 6th, 2011, 01:39 PM
#1
Thread Starter
Member
Set Label/Shape controls Parent ?
How can i Set Label/Shape controls Parent ---Set Parent function is not working with these controls...
-
Jun 6th, 2011, 02:25 PM
#2
Re: Set Label/Shape controls Parent ?
SetParent API only works for controls with hWnds. Labels, shape controls are windowless. You cannot move a windowless control from one form to another form, but you can move it in/out of containers within the form.... Let's say Label1 was on the form & you want to put it inside a picturebox on the same form:
Set Label1.Container = Picture1
Edited: So not using SetParent API, but using Set .Parent property? Either way, no can do. Set the .Container property as I described above.
Last edited by LaVolpe; Jun 6th, 2011 at 02:35 PM.
-
Jun 6th, 2011, 02:33 PM
#3
Re: Set Label/Shape controls Parent ?
You don't use Set Parent.
Labels and shapes cannot be set as Parents but they can be the child of another control
Set Label1.Container = Picture1
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jun 6th, 2011, 03:13 PM
#4
Thread Starter
Member
Re: Set Label/Shape controls Parent ?
Thank you guys...
I have a picture1(0) and a Shape1(0) inside the picture1(0)...I am trying create controls at run time...
i want to create multiple picture1 + Shape1 sets... i.e picture1(1) + inside Shape1(1), picture1(2) + inside Shape1(2) etc...I can load the controls...but the shape controls not siting inside picture box
I have used:
Shape1(1).Container=picture1(1) but not getting the result...
Any help?
-
Jun 6th, 2011, 03:18 PM
#5
Thread Starter
Member
Re: Set Label/Shape controls Parent ?
Oh guys i am sorry...
I have to use:
Set Shape1(1).Container=picture1(1):
i used:
Shape1(1).Container=picture1(1)
It's working...thank you guys once again
-
May 23rd, 2014, 10:29 PM
#6
Hyperactive Member
Re: Set Label/Shape controls Parent ?
i am having same problem but the problem is i need to use set parent api because the target control is from another app. i move a control from a background running app to my app (to show status) and i need to place my label on that control. and i only have hwnd for that control. So, how i can achieve that?
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
|