wiews : label & button confusion

Zdroid

Member
Licensed User
Longtime User
first off, pardon me if my question is irrelevant/stupid... :sign0104:
here is the thing
I made a code to format the views in the layout
maybe it's not how it should be done but anyway
the original code was that :

For I = 0 To Activity.NumberOfViews - 1
V = Activity.GetView(I)
If V Is Label Then
L = V
L.TextSize = txtSz
L.TextColor = Colors.Black
L.Color = Colors.Transparent
L.Typeface = Typeface.DEFAULT_BOLD
End If
Next

but then, I saw that the code was also affecting the buttons !?
so I had to modify it to that :

For I = 0 To Activity.NumberOfViews - 1
V = Activity.GetView(I)
If V Is Label And Not (V Is Button) Then
L = V
L.TextSize = txtSz
L.TextColor = Colors.Black
L.Color = Colors.Transparent
L.Typeface = Typeface.DEFAULT_BOLD
End If
Next

which does not look logical at all to me, even if it works...
so is that normal ? is a button also a label ?
TIA for any explanation !
 

Zdroid

Member
Licensed User
Longtime User
:signOops:

I was quite sure it was a known topic, did not search long enough or probably used wrong keywords

sorry for the redundant question

thanks for pointing out the explanation, it all makes sense now
 
Upvote 0
Top