Example #1
0
        private void NewPanel()
        {
            if (mTlgNames == null || mList == null)
            {
                return;
            }

            if (this.panStack.Count > 0)
            {
                this.panStack[panStack.Count - 1].setButAddView(false);
            }

            //CPositionCondPanel tmp = new CPositionCondPanel();
            CPositionCondPanel tmp = new CPositionCondPanel(this.mTlgNames, this.mList);

            tmp.setAddPositionCondPanelDel(new CPositionCondPanel.AddPositionCondPanelTyp(this.NewPanel));
            tmp.setRemovePositionCondPanelDel(new CPositionCondPanel.RemovePositionCondPanelTyp(this.RemovePositionCondPanel));
            this.panStack.Add(tmp);
            this.Controls.Add(tmp);
            tmp.Dock = DockStyle.Top;
            this.Refresh();

            //TabIndex bei allen PanelForm korigieren
            int index = panStack.Count - 1;

            foreach (CPositionCondPanel pan in this.panStack)
            {
                pan.TabIndex = index--;
            }

            //this.Size = new Size(this.Size.Width, this.Size.Height + tmp.Size.Height);
            tmp.Focus();
        }
Example #2
0
 private void RemovePositionCondPanel(CPositionCondPanel panel)
 {
     if (panel != null && this.panStack.Count > 1)
     {
         //this.Size = new Size(this.Size.Width, this.Size.Height - panel.Size.Height);
         this.Controls.Remove(panel);
         this.panStack.Remove(panel);
         this.panStack[panStack.Count - 1].setButAddView(true);
         this.panStack[panStack.Count - 1].Focus();
     }
 }