/// <summary> /// This function fill the UserControl Magazines. /// </summary> /// <param name="MagazineList">This parameter is Product List.</param> /// <returns>This function returns User Control Magazines.</returns> public static UC_Magazines FillUC_MagazineList(List <Product> MagazineList) { UC_Magazines ucM = new UC_Magazines(); foreach (Magazine _magazine in MagazineList) { ucM.flowLayoutMagazines.Controls.Add(new UC_Magazine(_magazine)); } ucM.Dock = DockStyle.Fill; return(ucM); }
/// <summary> /// This function brings user control magazines to front. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnMagazine_Click(object sender, EventArgs e) { Logger.log("Click to Magazine button"); btnDashboard.BackColor = Color.LightBlue; btnBooks.BackColor = Color.LightBlue; btnMusicCDs.BackColor = Color.LightBlue; btnMagazine.BackColor = Color.Teal; btnMyOrders.BackColor = Color.LightBlue; btnMyCart.BackColor = Color.LightBlue; btnSetting.BackColor = Color.LightBlue; pnlSelectedButton.Visible = true; pnlSelectedButton.Location = new Point(0, 180); if (pnlContainer.Controls["UC_Magazines"] == null) { UC_Magazines ucM = new UC_Magazines(); ucM.Dock = DockStyle.Fill; pnlContainer.Controls.Add(ucM); } pnlContainer.Controls["UC_Magazines"].BringToFront(); }