public void Fill(Guid caller, IEnumerable <User> users, string title, string action, UserInfoControl.ButtonType type = UserInfoControl.ButtonType.Empty) { _users = users; titleLabel.Text = title; actionLabel.Text = action; userCardsLayoutPanel.Controls.Clear(); foreach (var u in users) { var ui = new UserInfoControl(u.Id); ui.SetType(u.Id == caller ? UserInfoControl.ButtonType.Empty : type); if (_userActionEvent != null) { ui.SetEvent(UserInfoControl.Option.ActionButtonClick, _userActionEvent); } userCardsLayoutPanel.Controls.Add(ui); } if (!userCardsLayoutPanel.VerticalScroll.Visible) { Size = new Size() { Height = Height, Width = Width - 17 } } ; }