Ejemplo n.º 1
0
 private void timer_Tick(object sender, EventArgs e)
 {
     if (draggingHolder != null && !draggingHolder.Dragging) draggingHolder = null;
     if (draggingHolder != null)
     {
         holders.Remove(draggingHolder);
         for (int i = 0; i < holders.Count + 1; i++)
         {
             if (i == holders.Count || holders[i].Location.Y > draggingHolder.Location.Y)
             {
                 holders.Insert(i, draggingHolder);
                 Console.WriteLine(i);
                 break;
             }
         }
     }
     int padding = 6;
     int y = padding;
     foreach (ActionHolder holder in holders)
     {
         if (holder != draggingHolder)
         {
             holder.Location = new Point(holder.Location.X, y);
         }
         y += holder.Size.Height + padding;
     }
 }
Ejemplo n.º 2
0
 private void panel1_DragEnter(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(typeof(ActionHolder)))
     {
         e.Effect = DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Scroll;
         draggingHolder = (ActionHolder)e.Data.GetData(typeof(ActionHolder));
         
     }
 }
Ejemplo n.º 3
0
 private void addActionHolder()
 {
     ActionHolder holder = new ActionHolder();
     this.panel1.Controls.Add(holder);
 }
Ejemplo n.º 4
0
        private void addActionHolder()
        {
            ActionHolder holder = new ActionHolder();

            this.panel1.Controls.Add(holder);
        }