This looks strange to me:
p.SetLayoutAnimated(0, 0, 0, 50dip, 30dip)
You declare a panel with these properties:
Left = 0, Top = 0, Width = 50dip, Height = 30dip
Then you define a rectangle
rect01.Initialize(50dip,0dip,50dip,40dip)
with thes properties:
Left = 50 dip, which is outsodes the panel!
Top = 0, OK
Right = 50dip, which means that the width = 0 !?
Bottom = 40dip, which is higher than the panel height.
Therefore, c1.DrawRect(rect01, xui.Color_Transparent, True,3) does nothing.