Example #1
0
        public void Add(Expander expander)
        {
            if (this.Controls.Count > 0)
            expander.Collapse();

              expander.Width = this.Width - this.Margin.Horizontal - expander.Margin.Horizontal;
              this.Controls.Add(expander);

              expander.StateChanging += new CancelEventHandler(expander_StateChanging);
              expander.StateChanged += new EventHandler(expander_StateChanged);

              ArrangeLayout();
        }
Example #2
0
 public static Label CreateLabelHeader(Expander expander, string text, Color backColor, Image collapsedImage = null, Image expandedImage = null, int height = 25, Font font = null)
 {
     Label headerLabel = new Label();
       headerLabel.Text = text;
       headerLabel.AutoSize = false;
       headerLabel.Height = height;
       if (font != null)
     headerLabel.Font = font;
       headerLabel.TextAlign = ContentAlignment.MiddleLeft;
       if (collapsedImage != null && expandedImage != null)
       {
     headerLabel.Image = collapsedImage;
     headerLabel.ImageAlign = ContentAlignment.MiddleRight;
       }
       headerLabel.BackColor = backColor;
       if (collapsedImage != null && expandedImage != null)
       {
     expander.StateChanged += delegate { headerLabel.Image = expander.Expanded ? collapsedImage : expandedImage; };
       }
       headerLabel.Click += delegate { expander.Toggle(); };
       expander.Header = headerLabel;
       return headerLabel;
 }
 /// <summary>
 /// Fügt jede Dusche einzeln als Expander zu einer Accordion-Ansicht hinzu. 
 /// Dabei wird auch gleich die Grafik initialisiert. 
 /// </summary>
 /// <param name="shower">Einzelne Dusche</param>
 public void addShowerExpander(Notfalldusche shower)
 {
     Expander expander = new Expander();
       expander.BorderStyle = BorderStyle.FixedSingle;
       expander.Size = new Size(500, 400);
       expander.Tag = shower;
       ExpanderHelper.CreateLabelHeader(expander, shower.name, SystemColors.ActiveBorder);
       Chart chart = new Chart();
       chart.Size = new Size(500, 400);
       chart.Dock = DockStyle.Top;
       chart.ChartAreas.Add("Testing");
       chart.Legends.Add("Legende");
       chart.Series.Add(new Series("Aktivität"));
       chart.Series.Add(new Series("Flussrate"));
       chart.Series.Add(new Series("Temperatur"));
       chart.Series[0].ChartType = SeriesChartType.Range;
       chart.Series[1].ChartType = SeriesChartType.FastLine;
       chart.Series[2].ChartType = SeriesChartType.FastLine;
       chart.Series[0].ChartArea = "Testing";
       chart.Series[1].ChartArea = "Testing";
       chart.Series[2].ChartArea = "Testing";
       expander.Content = chart;
       accordion.Add(expander);
 }