Widget Well-Known Member Licensed User Longtime User Aug 8, 2011 #1 If I have Sub Globals dim Label1 as Label ... Then later on: Label1.Parent = Panel2 I will get a compile error saying it doesn't know what "Parent" is. Why? The Designer shows a Parent property in the Designer for Label1. I want to create labels dynamically and display them on a particular panel, but I can't get by this simple example. Am I doing something wrong? TIA Widget
If I have Sub Globals dim Label1 as Label ... Then later on: Label1.Parent = Panel2 I will get a compile error saying it doesn't know what "Parent" is. Why? The Designer shows a Parent property in the Designer for Label1. I want to create labels dynamically and display them on a particular panel, but I can't get by this simple example. Am I doing something wrong? TIA Widget
K kickaha Well-Known Member Licensed User Longtime User Aug 8, 2011 #2 You need to add the label to the panel using Code: Panel2.AddView (Label1,Left, Top, Width, Height) Obviously replace Left, Top, Width and Height with appropriate values. Upvote 0
You need to add the label to the panel using Code: Panel2.AddView (Label1,Left, Top, Width, Height) Obviously replace Left, Top, Width and Height with appropriate values.
Erel B4X founder Staff member Licensed User Longtime User Aug 9, 2011 #3 Parent is a readonly property. You cannot assign anything to it. Upvote 0
francoisg Active Member Licensed User Longtime User Sep 21, 2011 #4 Can you actually get the parent property of a view??? I can't seem to find it (maybe I am doing something wrong?)!!! Need it in order to create a generic function that need to know what the parent of the sender view is!!! Upvote 0
Can you actually get the parent property of a view??? I can't seem to find it (maybe I am doing something wrong?)!!! Need it in order to create a generic function that need to know what the parent of the sender view is!!!
Erel B4X founder Staff member Licensed User Longtime User Sep 21, 2011 #5 You are correct. There is no such property. It is only available in the designer. You can use the Tag property to store the parent view. Upvote 0
You are correct. There is no such property. It is only available in the designer. You can use the Tag property to store the parent view.
francoisg Active Member Licensed User Longtime User Sep 22, 2011 #6 Already used the Tag property for something else (running out of properties here - have to use a new type to store multiple values in the Tag), Thank you anyway ... Upvote 0
Already used the Tag property for something else (running out of properties here - have to use a new type to store multiple values in the Tag), Thank you anyway ...
Erel B4X founder Staff member Licensed User Longtime User Sep 22, 2011 #7 running out of properties here - have to use a new type to store multiple values in the Tag Click to expand... This is a good and correct solution. You can store any information required with a custom type. Upvote 0
running out of properties here - have to use a new type to store multiple values in the Tag Click to expand... This is a good and correct solution. You can store any information required with a custom type.