How to quickly highlight a panel?

Widget

Well-Known Member
Licensed User
Longtime User
I have panels on the screen and when the user moves his finger over one of the panels, I'd like to draw a red rectangle around the panel to tell the user the panel is selected. This is easy enough to do with Panel1.Touch, but how do I erase the rectangle when the user moves to another panel?

In the good old days of Delphi I would draw 4 XOR lines in the shape of a rectangle on the object's canvas and when I want to remove it I would XOR it again with the background and the background returns to its original image. (An XOR of an XOR turns it back to the original value.)

What is the best way to do it in B4A?

TIA
Widget
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
In the picture below, the border around the panel is done with four skinny labels, then
I make ".visible = False" the one on the side closest to the cards to which the text is
referring. I don't know if something like that would work for you...

 
Upvote 0

Widget

Well-Known Member
Licensed User
Longtime User
nfordbscndrd,
That is a real interesting solution to the problem. I hadn't thought of using filled labels as rectangles. Why B4A doesn't have a Shape view is beyond me. A Shape view could have a property of Rectangle, Circle, Triangle etc..

But your method does work. Thanks.:sign0060:

Widget
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…