Exemplo n.º 1
0
 public void RemoveColor(string text)
 {
     if (getColorByText(text) != null)
     {
         GradientColor gc = getColorByText(text);
         panel1.Controls.Remove(gc);
     }
 }
Exemplo n.º 2
0
        public void AddColor(Color gcl, string text)
        {
            GradientColor gc = new GradientColor();

            gc.Text           = text;
            gc._GradientColor = gcl;
            panel1.Controls.Add(gc);
        }
Exemplo n.º 3
0
 public void Select(GradientColor gc)
 {
     Selected = gc;
     foreach (GradientColor gcc in panel1.Controls)
     {
         gcc.BackColor = SystemColors.Control;
     }
     gc.BackColor = Color.FromArgb(255, 0, 100, 255);
 }
Exemplo n.º 4
0
        public void Move(string text, MoveDirection direction)
        {
            GradientColor gc = getColorByText(text);

            switch (direction)
            {
            case MoveDirection.Up:

                if (panel1.Controls.IndexOf(gc) < panel1.Controls.Count - 1)
                {
                    int cp = panel1.Controls.IndexOf(gc);
                    panel1.Controls.SetChildIndex(gc, cp + 1);
                }
                break;

            case MoveDirection.Down:
                if (panel1.Controls.IndexOf(gc) > 0)
                {
                    int cp = panel1.Controls.IndexOf(gc);
                    panel1.Controls.SetChildIndex(gc, cp - 1);
                }
                break;
            }
        }