예제 #1
0
        void moveDown(TableLayoutPanel tlp, List <TGIBlockCombo> ltbc, Label lb, TLPRenumber renumber, ref int entry)
        {
            TGIBlockCombo c1 = tlp.GetControlFromPosition(2, entry + 1) as TGIBlockCombo; //this control
            TGIBlockCombo c2 = tlp.GetControlFromPosition(2, entry + 2) as TGIBlockCombo; //the one below to swap with

            tlp.Controls.Remove(c1);                                                      //leaves entry + 1 free
            tlp.Controls.Add(c2, 2, entry + 1);                                           //leaves entry + 2 free
            tlp.Controls.Add(c1, 2, entry + 2);
            c2.TabIndex--;
            c1.TabIndex++;

            int i = ltbc.IndexOf(c1);

            ltbc.RemoveAt(i);
            ltbc.Insert(i + 1, c1);

            entry++;
            tlp.Controls.Add(lb, 1, entry + 1);
            renumber();
            c1.Focus();
        }
예제 #2
0
        void moveDown(TableLayoutPanel tlp, List<TGIBlockCombo> ltbc, Label lb, TLPRenumber renumber, ref int entry)
        {
            TGIBlockCombo c1 = tlp.GetControlFromPosition(2, entry + 1) as TGIBlockCombo;//this control
            TGIBlockCombo c2 = tlp.GetControlFromPosition(2, entry + 2) as TGIBlockCombo;//the one below to swap with
            tlp.Controls.Remove(c1);//leaves entry + 1 free
            tlp.Controls.Add(c2, 2, entry + 1);//leaves entry + 2 free
            tlp.Controls.Add(c1, 2, entry + 2);
            c2.TabIndex--;
            c1.TabIndex++;

            int i = ltbc.IndexOf(c1);
            ltbc.RemoveAt(i);
            ltbc.Insert(i + 1, c1);

            entry++;
            tlp.Controls.Add(lb, 1, entry + 1);
            renumber();
            c1.Focus();
        }