Hi All,
I have a number of labels [lblF0 - lblF15], the TextColor of these labels is changed programatically.
When I build a LIST of these labels I want the list Textcolor to match the laabel text color.
When I try to build the list using a loop I can't figure out how to make the Label name using the loop counter. [IE lblF&i doesn't work.] I suspect that it could be done using a java object haven' been able to find anything is searching.
Any help much appreciated.
Regards Roger
I have a number of labels [lblF0 - lblF15], the TextColor of these labels is changed programatically.
When I build a LIST of these labels I want the list Textcolor to match the laabel text color.
When I try to build the list using a loop I can't figure out how to make the Label name using the loop counter. [IE lblF&i doesn't work.] I suspect that it could be done using a java object haven' been able to find anything is searching.
Any help much appreciated.
B4X:
Sub FNumSelect
'Brings up ListView to allow selection of F0-F15 as assigned function.
'Called by Formula_click
ListFlag = 1
Dim FNumLabel As Label 'Set the parameters for displaying the Items of the ListView
FNumLabel = FNumView.SingleLineLayout.Label '
FNumLabel.TextSize = 18*FontScale '
'FNumLabel.TextColor = Colors.White '
FNumLabel.Color = Colors.DarkGray '
FNumLabel.Height = 5.6%y 'Label height and Item Height should match to avoid gsps & overlaps
FNumView.SingleLineLayout.ItemHeight = FNumView.SingleLineLayout.Label.Height
FNumView.Color = Colors.DarkGray 'ListView color matches Label color as labels don't fill ListView
FNumView.Clear 'Clear Listview before populating or else you get duplicates
' This is the bit where I need help
For i = 0 To 15 'Builds the viewable list RecallView from the List "storelist"
FNumLabel.TextColor = lblF&i.TextColor 'Assign LIST Label textcolour from existing label textcolour???????????????
FNumView.AddSingleLine("F" & i)
Next
Activity.AddView(FNumView, 0, 10%y, 100%x, 90%y) 'Displays the list built by the previous loop.
lblTitle.Text = "Select a Function Key to Program"
lblTitle.TextSize = 14*FontScale
lblTitle.BringToFront
lblTitle.Height = 10%y
ListBack.BringToFront
ListBack.Height = 10%y
FNumView.BringToFront
End Sub
Regards Roger
Last edited: