Ejemplo n.º 1
0
        private InListMatrixBox AddMatrixBox()
        {
            var newMatrix = new InListMatrixBox();

            newMatrix.MatrixBox.MatrixChanged += matrixBox_MatrixChanged;
            newMatrix.RemoveButtonClicked     += newMatrix_RemoveButtonClicked;
            newMatrix.GripMouseDown           += newMatrix_GripMouseDown;
            tableLayoutPanel1.Controls.Add(newMatrix);
            RefreshScrollBar();
            return(newMatrix);
        }
Ejemplo n.º 2
0
 private void RemoveMatrixBox(InListMatrixBox control = null, bool refreshUI = true)
 {
     if (control == null)
     {
         if (tableLayoutPanel1.Controls.Count > 0)
         {
             var last = (InListMatrixBox)tableLayoutPanel1.Controls[tableLayoutPanel1.Controls.Count - 1];
             control = last;
         }
         else
         {
             return;
         }
     }
     control.MatrixBox.MatrixChanged -= matrixBox_MatrixChanged;
     control.RemoveButtonClicked     -= newMatrix_RemoveButtonClicked;
     tableLayoutPanel1.Controls.Remove(control);
     if (refreshUI)
     {
         RefreshScrollBar();
         ApplyMatrix();
     }
 }