Try this fragment for two panels:
var r = new Region( panel1.Bounds );
r.Union(panel2.Bounds);
var p = PointToScreen( Point.Empty );
r.Translate( p.X - Bounds.X, p.Y - Bounds.Y );
this.Region = r;
It can be executed in the handler for Load event.
Oh sorry its Windows Forms App (.net framework)