Android Question Saving label text colours to an array

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi All,

I know I should know this one, but the brain cells just don't click.

I have a number of lables lblF0 - lblF15 in which the textcolour changes. At some point I need to preserve the current text colours. I have attempted to do this in a for/next in various ways but all have failed.
Below was the code starting point but this stores a string [eg "lblF1.TextColor"] not the color number.

Code:
Dim Fcolours(16) As String
    For FCol = 0 To 15
        Fcolours(FCol) = "lblF"&FCol&".TextColor"
    Next

Regards Roger
 
If you can now read the colour directly from the Label, do you need to store it somewhere else?

Edit, sorry should have reread the first post.:(
 
Upvote 0
If you can now read the colour directly from the Label, do you need to store it somewhere else?

Edit, sorry should have reread the first post.:(


Steve105,

I should have said in first post the text colour in the label indicates if there is an associated function. In some modes all these functions are disabled and re-enabled in the original mode. Therefore I need to save the text colour when leaving on mode and restore it when returning.

I thought a For/Next loop would be simple, I have gone for the 16 lines of code solution.

Thanks for the reply
Roger
 
Upvote 0

Similar Threads

Replies
11
Views
5K
Replies
7
Views
3K
  • Article Article
Android Code Snippet Save and load CSBuilders
Replies
5
Views
7K
Replies
2
Views
4K
Back
Top