private void CorrectWidthForItems() { if (ItemViews == null || ItemViews.Count == 0) { return; } int width = panelItems.Width - 2; if (currentTopPosition > this.panelItems.Height) { width = panelItems.Width - 18; } ItemViews.ForEach((IMRUItemView item) => { Control itemControl = item as Control; itemControl.Width = width; // itemControl.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right); }); }
private void AttachMenuItems() { if (menuItem == null) { return; } menuItem.DropDownItems.Clear(); if (ItemViews != null && ItemViews.Count() > 0) { menuItem.Enabled = true; ItemViews.ForEach(itemView => { (itemView as MRUItemMenu).Appearance = menuItemAppearance; menuItem.DropDownItems.Add(itemView as ToolStripMenuItem); }); menuItem.DropDownItems.Add(new ToolStripSeparator()); menuItem.DropDownItems.Add(CreateClearAllMenu()); } else { menuItem.Enabled = false; } }