private void AddCarousel(string category) { Carousel carousel1 = new Carousel(category); try { carousel1.Width = carouselLayoutPanel.Width; carousel1.Anchor = AnchorStyles.Left | AnchorStyles.Right; carouselLayoutPanel.AddCarousel(carousel1); carousel1.Add(category); } catch(Exception ex) { LibMediaServiceCommon.Logging.Instance.WriteLine(ex); } }
public void AddCarousel(Carousel ctrl) { ctrl.Width = this.Width; ctrl.Left = 0; if (this._controls.Count == 0) { ctrl.Top = StartingPositionY; // just enough space so it is not under the LEFT button } else { int value = this._controls[this._controls.Count - 1].Top; ctrl.Top = (ctrl.Height + VerticalList.CarosuelSeperationSize) + value; } //ctrl.Location = new System.Drawing.Point(ctrl.HiddenX, ctrl.HiddenY); this._controls.Add(ctrl); this.panel1.Controls.Add(ctrl); }
private void SetDefaultPositions() { int i = 0; Carousel previous = new Carousel(); foreach (Control ctrl in this.panel1.Controls) { if (ctrl is Carousel) { ctrl.Left = 0; if (i == 0) { ctrl.Top = StartingPositionY; // just enough space so it is not under the LEFT button } else { int value = previous.Top; ctrl.Top = (previous.Height + VerticalList.CarosuelSeperationSize) + value; } previous = (Carousel)ctrl; i++; } } }