Android Question Add a border to a Panel

Status
Not open for further replies.

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, all.

Thank you in advance for answering my question.

In the Designer of B4A v4, we have the capability to add a border to a panel selecting border color and width.

QUESTION
How do I add a border to a panel that I add in code: Activity.Addview(panel1...)?
The dropdown list that shows after entering panel1. in the code does not show border as an option.

In the past, I used the panel (color1) upon panel(color2) to get a border effect.

Best regards.

Sandy
 

Martincg

Member
Licensed User
Longtime User
I don't have an answer but I am interested in this. I thought that the easiest way to produce what you want in a program would be to design one until you get what you want, then whenever you need a panel like that you could say something like

B4X:
Private example as panel' this is the designed panel
Private NewPanel1 As Panel

 NewPanel1.assign(example)  '?? some method needed to copy all the properties of a panel.
 NewPanel1.width = 300
etc

I posted a question asking how to do this but made no progress. If you know then I would like to find out.
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
try this ..
B4X:
Dim c As ColorDrawable
c.Initialize2(Colors.White,5dip,3dip,Colors.Red)
Panel1.Background = c
 
Last edited:
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
@Martincg,
I cannot be of help in this area.
Sandy

@@@@@@@

@Steve,
Thank you. I had seen the thread. Comprehensive and sophisticated piece of coding, indeed. I have not had an opportunity to use it.

@mangojack (MJ),
Very clever and succinct. I tested it. Thank you.

Best regards to both.

Sandy
 
Upvote 0
Status
Not open for further replies.
Top