public TaskTakerControl()
        {
            InitializeComponent();

            buttonMore.Click += delegate
            {
                TaskControl tk = new TaskControl();
                tk.Name = "tk" + panel1.Controls.Count + 1;
                tk.Size = new Size(panel1.Controls[0].Width, panel1.Controls[0].Height);

                //calculate Location Y
                int y = (panel1.Controls.Count * panel1.Controls[0].Height) + panel1.Controls[0].Height;

                tk.Location = new Point(panel1.Controls[0].Location.X, y);

                panel1.Controls.Add(tk);

                // how to check if a is TaskContol
                // Control a = panel1.Controls[0];
                //if (a is TaskControl)
            };
            //TODO event for cancel
        }
Пример #2
0
        public TaskTakerControl()
        {
            InitializeComponent();

            buttonMore.Click += delegate
            {
                TaskControl tk = new TaskControl();
                tk.Name = "tk" + panel1.Controls.Count + 1;
                tk.Size = new Size(panel1.Controls[0].Width, panel1.Controls[0].Height);

                //calculate Location Y
                int y = (panel1.Controls.Count * panel1.Controls[0].Height) + panel1.Controls[0].Height;

                tk.Location = new Point(panel1.Controls[0].Location.X, y);

                panel1.Controls.Add(tk);


                // how to check if a is TaskContol
                // Control a = panel1.Controls[0];
                //if (a is TaskControl)
            };
            //TODO event for cancel
        }