F fanfalveto Active Member Licensed User Longtime User Nov 30, 2012 #1 Good afternoon. I have about twenty labels in an activity, how I can enable or disable all at once. One by one the code is eternal. thanks
Good afternoon. I have about twenty labels in an activity, how I can enable or disable all at once. One by one the code is eternal. thanks
klaus Expert Licensed User Longtime User Nov 30, 2012 #2 You can't do it at once. What you can do is either: - define an array of Labels and enable / disable them in a loop - put all Labels on a Panel and set Visible True / False, but this is not exactly what you are asking for. Best regards. Upvote 0
You can't do it at once. What you can do is either: - define an array of Labels and enable / disable them in a loop - put all Labels on a Panel and set Visible True / False, but this is not exactly what you are asking for. Best regards.
F fanfalveto Active Member Licensed User Longtime User Nov 30, 2012 #3 Thank you, i try to do first the array of labels,if i can`t do that then input all labels in a panel. Upvote 0
Thank you, i try to do first the array of labels,if i can`t do that then input all labels in a panel.
gulliver Member Licensed User Longtime User Nov 30, 2012 #4 fanfalveto said: Good afternoon. I have about twenty labels in an activity, how I can enable or disable all at once. One by one the code is eternal. thanks Click to expand... Have you tried: Code: Copy For Each v As View In Activity If v Is Label Then v.enabled = false Next Upvote 0
fanfalveto said: Good afternoon. I have about twenty labels in an activity, how I can enable or disable all at once. One by one the code is eternal. thanks Click to expand... Have you tried: Code: Copy For Each v As View In Activity If v Is Label Then v.enabled = false Next
F fanfalveto Active Member Licensed User Longtime User Nov 30, 2012 #5 Thank you very much,I saved a lot of code. I've done this: Code: Copy For Each v As View In Activity If v Is Label Then v.enabled = True v.Visible=True End If Next All labels enbled and visible in 6 lines. Thanks Upvote 0
Thank you very much,I saved a lot of code. I've done this: Code: Copy For Each v As View In Activity If v Is Label Then v.enabled = True v.Visible=True End If Next All labels enbled and visible in 6 lines. Thanks
M Mahares Expert Licensed User Longtime User Nov 30, 2012 #6 For Each v As View In Activity If v Is Label Then v.enabled = false Next Click to expand... I do not think the above will work because edittext views are also considered label. Therefore, they will also be disabled, unless of course you do not have edittext in tyour panel or activity. Perhaps, you can stick something in the tag. Upvote 0
For Each v As View In Activity If v Is Label Then v.enabled = false Next Click to expand... I do not think the above will work because edittext views are also considered label. Therefore, they will also be disabled, unless of course you do not have edittext in tyour panel or activity. Perhaps, you can stick something in the tag.
F fanfalveto Active Member Licensed User Longtime User Nov 30, 2012 #7 This solution is good for me because i disabled the labels one by one, when everyone is disabled i need enabled them all at once, I have a EditText but with this solution is not affected. Also i try the array and panel. Thanks Upvote 0
This solution is good for me because i disabled the labels one by one, when everyone is disabled i need enabled them all at once, I have a EditText but with this solution is not affected. Also i try the array and panel. Thanks