コード例 #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            var employeeList = db.GetList();
            int h = 0;
            foreach (var item in employeeList)
            {
                var control = new EmployeeControl(item);
                control.Parent = itemsPanel;
                control.Top = h;
                control.Left = 0;
                control.Width = itemsPanel.ClientSize.Width;
                control.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
                control.Changed += control_Changed;
                control.Show();

                controllsList.Add(control);
                h += control.Height;
            }
            this.Height = itemsPanel.Top + itemsPanel.Height + itemsPanel.Bottom + 10;
        }
コード例 #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            var employeeList = db.GetList();
            int h            = 0;

            foreach (var item in employeeList)
            {
                var control = new EmployeeControl(item);
                control.Parent   = itemsPanel;
                control.Top      = h;
                control.Left     = 0;
                control.Width    = itemsPanel.ClientSize.Width;
                control.Anchor   = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
                control.Changed += control_Changed;
                control.Show();

                controllsList.Add(control);
                h += control.Height;
            }
            this.Height = itemsPanel.Top + itemsPanel.Height + itemsPanel.Bottom + 10;
        }