Your question is a little unclear but i would bind to the double click event for each panel and use the sender paramater of the event to identify the panel clicked. This assumes win forms, WPF is a whole other thing and routed events can be used on the parent container.
public void InitializeComponent()
{
Panel[] panels = new Panel[] { new Panel(), new Panel() };
foreach (Panel panel in panels)
{
panel.DoubleClick += new EventHandler(panel_DoubleClick);
}
}
private void panel_DoubleClick(object sender, EventArgs e)
{
((Panel) sender).BackColor = Color.Red;
}