System\Windows\Forms\Design\ToolStripDesigner.cs (109)
147foreach (ToolStripItem item in ToolStrip.Items)
178InheritanceAttribute ia = (InheritanceAttribute)TypeDescriptor.GetAttributes(ToolStrip)[typeof(InheritanceAttribute)];
192internal override bool ControlSupportsSnaplines => ToolStrip.Parent is not ToolStripPanel;
201_toolStripContextMenu ??= new BaseContextMenuStrip(ToolStrip.Site)
284_miniToolStrip.Parent = ToolStrip;
377if (ToolStrip.OverflowButton.Visible)
379return ToolStrip.OverflowButton.Bounds;
450if (ToolStrip.Visible != value && !SelectionService.GetComponentSelected(ToolStrip))
466foreach (ToolStripItem item in ToolStrip.Items)
516ToolStrip.SuspendLayout();
536ToolStrip.ResumeLayout();
572ToolStrip.SuspendLayout();
634ToolStrip.ResumeLayout();
684ToolStrip.ResumeLayout();
734ToolStrip.Items.Add(_editorNode);
754if (item.Placement == ToolStripItemPlacement.Overflow && item.Owner == ToolStrip)
756if (ToolStrip.CanOverflow && !ToolStrip.OverflowButton.DropDown.Visible)
758ToolStrip.OverflowButton.ShowDropDown();
767if (ToolStrip.OverflowButton.DropDown.Visible)
769ToolStrip.OverflowButton.HideDropDown();
773if (item.Owner == ToolStrip)
788if (topMostItem is not null && topMostItem.Owner == ToolStrip)
802if (topMostItem is not null && topMostItem.Owner == ToolStrip)
904int count = ToolStrip.Items.Count;
912if (selectedItem.Owner == ToolStrip)
914int indexToInsert = ToolStrip.Items.IndexOf(selectedItem);
915ToolStrip.Items.Insert(indexToInsert, newItem);
921ToolStrip.Items.Insert(count - 1, newItem);
925ToolStrip.Items.Add(newItem);
975if (selectedItem is ToolStripItem currentSel && currentSel.Owner != ToolStrip)
1012if (parent == ToolStrip && e.Member is not null && e.Member.Name == "Overflow")
1019if (ToolStrip.CanOverflow && !ToolStrip.OverflowButton.DropDown.Visible)
1021ToolStrip.OverflowButton.ShowDropDown();
1035int itemIndex = ToolStrip.Items.IndexOf(item);
1041ToolStrip.Items.Remove(item);
1055if (ToolStrip.Items.Count > 1)
1057itemIndex = Math.Min(ToolStrip.Items.Count - 1, itemIndex);
1083IComponent targetSelection = (itemIndex == -1) ? ToolStrip : ToolStrip.Items[itemIndex];
1199if (ToolStrip.OverflowButton.DropDown.Visible)
1201ToolStrip.OverflowButton.HideDropDown();
1262if (!ToolStrip.IsHandleCreated)
1267if (TryGetService(out SelectionManager selectionManager) && ToolStrip is not null && CanAddItems && ToolStrip.Visible)
1274if (ToolStrip.Items.Count > 0)
1276ToolStripItem[] items = new ToolStripItem[ToolStrip.Items.Count];
1277ToolStrip.Items.CopyTo(items, 0);
1295foreach (ToolStripItem item in ToolStrip.Items)
1321Control parent = ToolStrip.Parent;
1377ContainerSelectorBehavior behavior = new(ToolStrip, Component.Site, true);
1435ToolStrip.OverflowButton.DropDown.TopLevel = false;
1486PropertyDescriptor dockProp = TypeDescriptor.GetProperties(ToolStrip)["Dock"];
1487dockProp?.SetValue(ToolStrip, DockStyle.None);
1491if (parentPanel is null || ToolStrip is MenuStrip)
1499if (ToolStrip is MenuStrip)
1504mainMenuStripProperty.SetValue(parentForm, ToolStrip as MenuStrip);
1511if (ToolStrip is not MenuStrip)
1517parentPanel.Join(ToolStrip, parentPanel.Rows.Length);
1522PropertyDescriptor locationProp = TypeDescriptor.GetProperties(ToolStrip)["Location"];
1523ComponentChangeService.OnComponentChanging(ToolStrip, locationProp);
1524ComponentChangeService.OnComponentChanged(ToolStrip, locationProp);
1532if (ToolStrip is MenuStrip)
1537if (c is ToolStrip && (c != ToolStrip))
1549parent.Controls.SetChildIndex(ToolStrip, index);
1579parent.Controls.SetChildIndex(ToolStrip, index - 1);
1633ToolStrip.PerformLayout();
1801ToolStrip parentToolStrip = ToolStrip;
1804if (ToolStrip.Orientation == Orientation.Horizontal)
1806if (ToolStrip.RightToLeft == RightToLeft.Yes)
1958int currentIndexOfEditor = ToolStrip.Items.IndexOf(_editorNode);
1959if (currentIndexOfEditor == -1 || currentIndexOfEditor != ToolStrip.Items.Count - 1)
1962ToolStrip.SuspendLayout();
1963ToolStrip.Items.Add(_editorNode);
1964ToolStrip.ResumeLayout();
1976if (!SelectionService.GetComponentSelected(ToolStrip))
2005ToolStripItem nextItem = ToolStrip.GetNextItem(ToolStrip.OverflowButton, ArrowDirection.Left);
2039BehaviorService.Invalidate(BehaviorService.ControlRectInAdornerWindow(ToolStrip));
2049foreach (ToolStripItem item in ToolStrip.Items)
2079ToolStrip.SuspendLayout();
2081ToolStrip.ResumeLayout();
2124if (_editorNode is not null && (ToolStrip.Items.IndexOf(_editorNode) == -1))
2126ToolStrip.Items.Add(_editorNode);
2132ToolStrip.ResumeLayout(true/*performLayout*/);
2133ToolStrip.PerformLayout();
2155if (CheckIfItemSelected() || SelectionService.GetComponentSelected(ToolStrip))
2158ToolStrip.SuspendLayout();
2167if (SelectionService.GetComponentSelected(ToolStrip))
2228foreach (ToolStripItem item in ToolStrip.Items)
2279if (data.Owner != ToolStrip)
2306if (!showToolStrip && !SelectionService.GetComponentSelected(ToolStrip))
2308ToolStrip.Visible = _currentVisible;
2311ToolStrip.Parent.Visible = _currentVisible;
2315if (ToolStrip.OverflowButton.DropDown.Visible)
2317ToolStrip.OverflowButton.HideDropDown();
2340bool showToolStrip = itemSelected || SelectionService.GetComponentSelected(ToolStrip);
2346if (SelectionService.GetComponentSelected(ToolStrip))
2348if (!DontCloseOverflow && ToolStrip.OverflowButton.DropDown.Visible)
2350ToolStrip.OverflowButton.HideDropDown();
2361if (ToolStrip.Parent is ToolStripPanel && !ToolStrip.Parent.Visible)
2364ToolStrip.Parent.Visible = true;
2373if (_editorNode is not null && (SelectionService.PrimarySelection == ToolStrip || itemSelected))
2422if (ToolStrip is MenuStrip)
2462foreach (ToolStripItem item in ToolStrip.Items)
2495if (!_addingDummyItem && !_disposed && (CheckIfItemSelected() || SelectionService.GetComponentSelected(ToolStrip)))