86 references to ToolStripItem
System.Windows.Forms.Design (86)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (82)
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); 371PropertyDescriptor textProp = TypeDescriptor.GetProperties(ToolStripItem)["Text"]; 372string oldValue = (string)textProp.GetValue(ToolStripItem); 375textProp.SetValue(ToolStripItem, text); 452ToolStripItem?.Paint -= OnItemPaint; 489protected virtual Component GetOwnerForActionList() => (ToolStripItem.Placement == ToolStripItemPlacement.Main) ? ToolStripItem.GetCurrentParent() : ToolStripItem.Owner; 491internal virtual ToolStrip GetMainToolStrip() => ToolStripItem.Owner; 499r = ToolStripItem.Bounds; 559ToolStripDesignerUtils.GetAdjustedBounds(ToolStripItem, ref r); 564if (ToolStripItem.IsOnDropDown) 566ToolStrip parent = ToolStripItem.GetCurrentParent(); 567parent ??= ToolStripItem.Owner; 612ToolStripItem.AutoSize = AutoSize; 625AutoSize = ToolStripItem.AutoSize; 630AccessibleName = ToolStripItem.AccessibleName; 631ToolStripItem.Paint += OnItemPaint; 634ToolStripItem.AccessibleName = ToolStripItem.Name; 663PropertyDescriptor pd = TypeDescriptor.GetProperties(ToolStripItem)["Text"]; 707parent = ToolStripItem.Owner; 712int dummyIndex = parent.Items.IndexOf(ToolStripItem); 713string name = ToolStripItem.Name; 717if (ToolStripItem.IsOnDropDown) 745ToolStripDropDownItem dropDownItem = ToolStripItem as ToolStripDropDownItem; 774parent.Items.Remove(ToolStripItem); 775host.DestroyComponent(ToolStripItem); 864host.Container.Add(ToolStripItem); 865parent.Items.Insert(dummyIndex, ToolStripItem); 882if (e.Component == ToolStripItem) 884ToolStripItem.AccessibleName = e.NewName; 893if (ToolStripItem.GetCurrentParent() is ToolStripDropDown 895&& ToolStripItem.Equals(_selectionService.PrimarySelection) 899Rectangle r = ToolStripItem.Bounds; 921if (ToolStripItem.AccessibilityObject is ToolStripItem.ToolStripItemAccessibleObject acc) 925if (sSvc.GetComponentSelected(ToolStripItem)) 944if (currentSelection == ToolStripItem) 959if (currentSelection is not null && currentSelection.Equals(ToolStripItem) && !(ToolStripItem is ToolStripMenuItem)) 1047parent.Items.Remove(ToolStripItem); 1048host.DestroyComponent(ToolStripItem); 1059private void RestoreAutoSize() => ToolStripItem.AutoSize = (bool)ShadowProperties[nameof(AutoSize)]; 1069private void RestoreOverflow() => ToolStripItem.Overflow = (ToolStripItemOverflow)ShadowProperties[nameof(Overflow)]; 1074private void ResetOverflow() => ToolStripItem.Overflow = ToolStripItemOverflow.AsNeeded; 1084private void RestoreAccessibleName() => ToolStripItem.AccessibleName = (string)ShadowProperties[nameof(AccessibleName)]; 1089if (ToolStripItem is ToolStripDropDownItem) 1099parent = ToolStripItem.Owner; 1102int currentIndex = parent.Items.IndexOf(ToolStripItem); 1146ToolStripItem.Visible = true; 1157ToolStripItem.Visible = _currentVisible; 1185if (ToolStripItem is ToolStripMenuItem) 1202Rectangle origBoundsInAdornerWindow = ToolStripItem.Bounds; 1204ToolStripItem.AutoSize = false; 1205_editorNode.SetWidth(ToolStripItem.Text); 1208ToolStripItem.Width = _editorNode.EditorToolStrip.Width + 2; 1212ToolStripItem.Height = _editorNode.EditorToolStrip.Height; 1221if (ToolStripItem.Placement != ToolStripItemPlacement.None) 1223Rectangle boundsInAdornerWindow = ToolStripItem.Bounds; 1230boundsInAdornerWindow.Y += (ToolStripItem.Height - _editorNode.EditorToolStrip.Height) / 2; 1235boundsInAdornerWindow.X += (ToolStripItem.Width - _editorNode.EditorToolStrip.Width) / 2; 1248parentDesigner.EditManager.ActivateEditor(ToolStripItem); 1259ToolStripItem.AutoSize = AutoSize; 1260if (ToolStripItem is ToolStripDropDownItem) // We have no place to show this item... so Hide the DropDown 1262if (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)