public static void generateDashboard(List <Label> ibanList, Panel panelMainDashboard, Label exchangeTbl) { ibanList.Clear(); int i = 0; List <string> list = DataManagement.getDashboardInfo(); foreach (string iban in list) { var context = new MitBankDBEntities(); Label lb = UIDashboardAccountFrame.createFrame(iban, i); i++; ibanList.Add(lb); } foreach (Label lb in ibanList) { panelMainDashboard.Controls.Add(lb); lb.BringToFront(); } exchangeTbl = UIDashboardAccountFrame.getExchangeTable(); panelMainDashboard.Controls.Add(exchangeTbl); }