Android Question Add a border to a Panel


Well-Known Member
Licensed 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.

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.



Licensed 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

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
I posted a question asking how to do this but made no progress. If you know then I would like to find out.


Well-Known Member
Licensed User
I cannot be of help in this area.


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.