Spanish Cambiar color de fondo de un label?

benji

Active Member
Licensed User
Longtime User
Eso, como cambio el color de fondo de un label?
si yo hago esto
lblPto2.Background = Colors.Gray

tengo un error de tipo...

de antemano gracias.
 

eurojam

Well-Known Member
Licensed User
Longtime User
si utilizas Background, tiene que ser:
B4X:
    Dim cd As ColorDrawable
    cd.Initialize(Colors.Yellow, 5dip)
    lblPto2.Background=cd
 

aviario

Active Member
Licensed User
Longtime User
Yo lo hago de esta forma

Rutinas.PonFondo_Label(Pta1,248,250,193,248,250,193)


Sub PonFondo_Label(Lbl As Label,Cl1 As String,Cl2 As String,Cl3 As String,Cl4 As String,Cl5 As String,Cl6 As String)
Dim gr As GradientDrawable
Dim Cols(2) As Int
Cols(0) = Colors.RGB(Cl1,Cl2,Cl3)
Cols(1) = Colors.RGB(Cl4,Cl5,Cl6)
gr.Initialize("BL_TR", Cols)
gr.CornerRadius=5
Lbl.Background = gr
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…