T Turbo3 Active Member Licensed User Longtime User Jan 20, 2017 #1 I have a label I need to change the border color depending on user input. In B4i I use label.SetBorder(1,Colors."newcolor,"5) but when I try to map this to my Android app I can not find a "SetBorder" option on label. I don't need to change the width or radius just the color.
I have a label I need to change the border color depending on user input. In B4i I use label.SetBorder(1,Colors."newcolor,"5) but when I try to map this to my Android app I can not find a "SetBorder" option on label. I don't need to change the width or radius just the color.
mangojack Expert Licensed User Longtime User Jan 21, 2017 #2 Code: Copy Dim cd As ColorDrawable cd.Initialize2(Colors.Transparent, 5dip, 2dip, Colors.Red) Label1.Background = cd Upvote 0
Code: Copy Dim cd As ColorDrawable cd.Initialize2(Colors.Transparent, 5dip, 2dip, Colors.Red) Label1.Background = cd
M Mahares Expert Licensed User Longtime User Jan 21, 2017 #3 You can use the color drawable: Code: Copy Dim MyBorder = Colors.Red As Int cd.Initialize2(Colors.RGB(Rnd(0,256),Rnd(0,256),Rnd(0,256)),5dip,4dip,MyBorder) Label1.Text="Powerful B4A" Label1.background=cd EDIT: Sorry, @mangojack had it ahead of me. Last edited: Jan 21, 2017 Upvote 0
You can use the color drawable: Code: Copy Dim MyBorder = Colors.Red As Int cd.Initialize2(Colors.RGB(Rnd(0,256),Rnd(0,256),Rnd(0,256)),5dip,4dip,MyBorder) Label1.Text="Powerful B4A" Label1.background=cd EDIT: Sorry, @mangojack had it ahead of me.