示例#1
0
        private void reLayoutItem(int i)
        {
            CheckTypeInputPanel item    = (CheckTypeInputPanel)checkPanel.Controls[i];
            CheckTypeInputPanel preItem = (CheckTypeInputPanel)checkPanel.Controls[i - 1];

            item.Location = new Point(checkPanel.Width / 2 - item.Width / 2, preItem.Location.Y + preItem.Height);
        }
示例#2
0
        private void layoutBottomInputPanel(ref CheckTypeInputPanel inputPanel)
        {
            int controlsLoactionX = checkPanel.Width / 2 - inputPanel.Width / 2;
            int bottomPanelIndex  = checkPanel.Controls.Count - 1;
            CheckTypeInputPanel bottomInputPanel = (CheckTypeInputPanel)checkPanel.Controls[checkPanel.Controls.Count - 1];

            inputPanel.Location = new Point(controlsLoactionX, bottomInputPanel.Location.Y + bottomInputPanel.Height);
        }
示例#3
0
 /* ---- Delete ---- */
 private void checkTypeInputPanel_Delete(CheckTypeInputPanel sender)
 {
     for (int i = 0; i < checkPanel.Controls.Count; i++)
     {
         if (i == 0)
         {
             reLayoutFirstItem();
         }
         else
         {
             reLayoutItem(i);
         }
     }
 }
示例#4
0
        /* ---- Add a item ---- */
        private void checkTypeAddButton_Click(object sender, EventArgs e)
        {
            CheckTypeInputPanel checkTypeInputPanel = new CheckTypeInputPanel();

            if (checkPanel.Controls.Count == 0)
            {
                layoutFirstInputPanel(ref checkTypeInputPanel);
            }
            else
            {
                layoutBottomInputPanel(ref checkTypeInputPanel);
            }
            checkTypeInputPanel.afterDelete += checkTypeInputPanel_Delete;
            addInputPanel(ref checkTypeInputPanel);
        }
示例#5
0
        private void reLayoutFirstItem()
        {
            CheckTypeInputPanel item = (CheckTypeInputPanel)checkPanel.Controls[0];

            item.Location = new Point(checkPanel.Width / 2 - item.Width / 2, 0);
        }
示例#6
0
 private void addInputPanel(ref CheckTypeInputPanel inputPanel)
 {
     checkPanel.Controls.Add(inputPanel);
     inputPanel.resizeSelf();
 }
示例#7
0
        private void layoutFirstInputPanel(ref CheckTypeInputPanel inputPanel)
        {
            int controlsLoactionX = checkPanel.Width / 2 - inputPanel.Width / 2;

            inputPanel.Location = new Point(controlsLoactionX, 0);
        }