87 references to ToolStripItem
System.Windows.Forms.Design (87)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (83)
49ToolStripItem.AutoSize = value; 93_toolStripItemCustomMenuItemCollection ??= new ToolStripItemCustomMenuItemCollection(Component.Site, ToolStripItem); 157if (ToolStripItem is not null) 159ToolStrip parent = ToolStripItem.GetCurrentParent(); 160return parent ?? ToolStripItem.Owner; 173if (ToolStripItem.IsOnOverflow) 175ToolStrip strip = ToolStripItem.Owner; 182if (ToolStripItem is ToolStripDropDownItem) 184ToolStripDropDownItem item = ToolStripItem as ToolStripDropDownItem; 189if (value != ToolStripItem.Overflow) 191ToolStripItem.Overflow = value; 204if (ToolStripItem is not null) 206if (ToolStripItem.IsOnDropDown && !ToolStripItem.IsOnOverflow) 253Component startComp = ToolStripItem; 315_editorNode = new ToolStripTemplateNode(ToolStripItem, ToolStripItem.Text); 334ToolStripDesigner designer = (ToolStripDesigner)designerHost.GetDesigner(ToolStripItem.Owner); 374PropertyDescriptor textProp = TypeDescriptor.GetProperties(ToolStripItem)["Text"]; 375string oldValue = (string)textProp.GetValue(ToolStripItem); 378textProp.SetValue(ToolStripItem, text); 464if (ToolStripItem is not null) 466ToolStripItem.Paint -= OnItemPaint; 507protected virtual Component GetOwnerForActionList() => (ToolStripItem.Placement == ToolStripItemPlacement.Main) ? ToolStripItem.GetCurrentParent() : ToolStripItem.Owner; 509internal virtual ToolStrip GetMainToolStrip() => ToolStripItem.Owner; 517r = ToolStripItem.Bounds; 577ToolStripDesignerUtils.GetAdjustedBounds(ToolStripItem, ref r); 582if (ToolStripItem.IsOnDropDown) 584ToolStrip parent = ToolStripItem.GetCurrentParent(); 585parent ??= ToolStripItem.Owner; 630ToolStripItem.AutoSize = AutoSize; 646AutoSize = ToolStripItem.AutoSize; 651AccessibleName = ToolStripItem.AccessibleName; 652ToolStripItem.Paint += OnItemPaint; 655ToolStripItem.AccessibleName = ToolStripItem.Name; 684PropertyDescriptor pd = TypeDescriptor.GetProperties(ToolStripItem)["Text"]; 728parent = ToolStripItem.Owner; 733int dummyIndex = parent.Items.IndexOf(ToolStripItem); 734string name = ToolStripItem.Name; 738if (ToolStripItem.IsOnDropDown) 766ToolStripDropDownItem dropDownItem = ToolStripItem as ToolStripDropDownItem; 795parent.Items.Remove(ToolStripItem); 796host.DestroyComponent(ToolStripItem); 885host.Container.Add(ToolStripItem); 886parent.Items.Insert(dummyIndex, ToolStripItem); 906if (e.Component == ToolStripItem) 908ToolStripItem.AccessibleName = e.NewName; 917if (ToolStripItem.GetCurrentParent() is ToolStripDropDown 919&& ToolStripItem.Equals(_selectionService.PrimarySelection) 923Rectangle r = ToolStripItem.Bounds; 945if (ToolStripItem.AccessibilityObject is ToolStripItem.ToolStripItemAccessibleObject acc) 949if (sSvc.GetComponentSelected(ToolStripItem)) 968if (currentSelection == ToolStripItem) 983if (currentSelection is not null && currentSelection.Equals(ToolStripItem) && !(ToolStripItem is ToolStripMenuItem)) 1071parent.Items.Remove(ToolStripItem); 1072host.DestroyComponent(ToolStripItem); 1083private void RestoreAutoSize() => ToolStripItem.AutoSize = (bool)ShadowProperties[nameof(AutoSize)]; 1093private void RestoreOverflow() => ToolStripItem.Overflow = (ToolStripItemOverflow)ShadowProperties[nameof(Overflow)]; 1098private void ResetOverflow() => ToolStripItem.Overflow = ToolStripItemOverflow.AsNeeded; 1108private void RestoreAccessibleName() => ToolStripItem.AccessibleName = (string)ShadowProperties[nameof(AccessibleName)]; 1113if (ToolStripItem is ToolStripDropDownItem) 1123parent = ToolStripItem.Owner; 1126int currentIndex = parent.Items.IndexOf(ToolStripItem); 1170ToolStripItem.Visible = true; 1181ToolStripItem.Visible = _currentVisible; 1209if (ToolStripItem is ToolStripMenuItem) 1226Rectangle origBoundsInAdornerWindow = ToolStripItem.Bounds; 1228ToolStripItem.AutoSize = false; 1229_editorNode.SetWidth(ToolStripItem.Text); 1232ToolStripItem.Width = _editorNode.EditorToolStrip.Width + 2; 1236ToolStripItem.Height = _editorNode.EditorToolStrip.Height; 1245if (ToolStripItem.Placement != ToolStripItemPlacement.None) 1247Rectangle boundsInAdornerWindow = ToolStripItem.Bounds; 1254boundsInAdornerWindow.Y += (ToolStripItem.Height - _editorNode.EditorToolStrip.Height) / 2; 1259boundsInAdornerWindow.X += (ToolStripItem.Width - _editorNode.EditorToolStrip.Width) / 2; 1272parentDesigner.EditManager.ActivateEditor(ToolStripItem); 1283ToolStripItem.AutoSize = AutoSize; 1284if (ToolStripItem is ToolStripDropDownItem) // We have no place to show this item... so Hide the DropDown 1286if (ToolStripItem is ToolStripDropDownItem ddItem)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (4)
248get => ToolStripItem as ToolStripDropDownItem; 326if (ToolStripItem is not null) 328if (!ToolStripItem.IsOnOverflow && ToolStripItem.IsOnDropDown)