S sorex Expert Licensed User Longtime User Jul 21, 2012 #1 Hello, I'm creating a few labels on the fly and want to access their properties later on. Unfortunately I can't seem to get it working. here's the loop... Code: Copy For x=0 To 10-1 Dim mypic As mypic.Initialize("") mypic.Tag=x Activity.AddView(mypic, 0, x*s, Activity.Width , 5) Next it seems that I can access the last created object with mypic.width=1 is there a way to acces it via the tag like mypic(3) in some way?
Hello, I'm creating a few labels on the fly and want to access their properties later on. Unfortunately I can't seem to get it working. here's the loop... Code: Copy For x=0 To 10-1 Dim mypic As mypic.Initialize("") mypic.Tag=x Activity.AddView(mypic, 0, x*s, Activity.Width , 5) Next it seems that I can access the last created object with mypic.width=1 is there a way to acces it via the tag like mypic(3) in some way?
klaus Expert Licensed User Longtime User Jul 21, 2012 #2 This looks strange to me ? Code: Copy Dim mypic As mypic.Initialize("") You could use either : - an array of labels Code: Copy Dim mypic(10) As Label . . For x=0 To 9 mypic(x).Initialize("") mypic(x).Tag=x Activity.AddView(mypic(x), 0, x*s, Activity.Width , 5) Next . . mypic(i).Width = 1 - or with this (works as is only if you have no other views in the activity) Code: Copy Dim lbl As Label lbl = Activity.GetView(i) lbl.Width = 1 Best regards. Upvote 0
This looks strange to me ? Code: Copy Dim mypic As mypic.Initialize("") You could use either : - an array of labels Code: Copy Dim mypic(10) As Label . . For x=0 To 9 mypic(x).Initialize("") mypic(x).Tag=x Activity.AddView(mypic(x), 0, x*s, Activity.Width , 5) Next . . mypic(i).Width = 1 - or with this (works as is only if you have no other views in the activity) Code: Copy Dim lbl As Label lbl = Activity.GetView(i) lbl.Width = 1 Best regards.
S sorex Expert Licensed User Longtime User Jul 21, 2012 #3 yeah, something got messed up with the copy paste. your array thing works excellent, thanks! Upvote 0