Setting color to DEFAULT in code

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I know how to set something to DEFAULT color in the designer but how to do this in code without using a workaround?

Custom developed views have no properties that can be set in the designer so many times I need to find a way to set the color to DEFAULT by code.

Because my apps. need to work on all Android OS'es I only want to use default colors to make sure they still look good on old Android versions.

Cheers,
 

Hamo

Member
Licensed User
Longtime User
You could save the original color and restore it later.

Dim B1 as Button
B1.Tag=B1.Background 'Store original color in tag in activity_Create
B1.Color=Colors.Red 'Change button color to red


Sub B1_Click 'Return button color to original before it was changed to red
B1.Background=B1.Tag
End Sub

Hamo
 
Upvote 0
Top