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); 371PropertyDescriptor textProp = TypeDescriptor.GetProperties(ToolStripItem)["Text"]; 372string oldValue = (string)textProp.GetValue(ToolStripItem); 375textProp.SetValue(ToolStripItem, text); 452if (ToolStripItem is not null) 454ToolStripItem.Paint -= OnItemPaint; 495protected virtual Component GetOwnerForActionList() => (ToolStripItem.Placement == ToolStripItemPlacement.Main) ? ToolStripItem.GetCurrentParent() : ToolStripItem.Owner; 497internal virtual ToolStrip GetMainToolStrip() => ToolStripItem.Owner; 505r = ToolStripItem.Bounds; 565ToolStripDesignerUtils.GetAdjustedBounds(ToolStripItem, ref r); 570if (ToolStripItem.IsOnDropDown) 572ToolStrip parent = ToolStripItem.GetCurrentParent(); 573parent ??= ToolStripItem.Owner; 618ToolStripItem.AutoSize = AutoSize; 631AutoSize = ToolStripItem.AutoSize; 636AccessibleName = ToolStripItem.AccessibleName; 637ToolStripItem.Paint += OnItemPaint; 640ToolStripItem.AccessibleName = ToolStripItem.Name; 669PropertyDescriptor pd = TypeDescriptor.GetProperties(ToolStripItem)["Text"]; 713parent = ToolStripItem.Owner; 718int dummyIndex = parent.Items.IndexOf(ToolStripItem); 719string name = ToolStripItem.Name; 723if (ToolStripItem.IsOnDropDown) 751ToolStripDropDownItem dropDownItem = ToolStripItem as ToolStripDropDownItem; 780parent.Items.Remove(ToolStripItem); 781host.DestroyComponent(ToolStripItem); 870host.Container.Add(ToolStripItem); 871parent.Items.Insert(dummyIndex, ToolStripItem); 888if (e.Component == ToolStripItem) 890ToolStripItem.AccessibleName = e.NewName; 899if (ToolStripItem.GetCurrentParent() is ToolStripDropDown 901&& ToolStripItem.Equals(_selectionService.PrimarySelection) 905Rectangle r = ToolStripItem.Bounds; 927if (ToolStripItem.AccessibilityObject is ToolStripItem.ToolStripItemAccessibleObject acc) 931if (sSvc.GetComponentSelected(ToolStripItem)) 950if (currentSelection == ToolStripItem) 965if (currentSelection is not null && currentSelection.Equals(ToolStripItem) && !(ToolStripItem is ToolStripMenuItem)) 1053parent.Items.Remove(ToolStripItem); 1054host.DestroyComponent(ToolStripItem); 1065private void RestoreAutoSize() => ToolStripItem.AutoSize = (bool)ShadowProperties[nameof(AutoSize)]; 1075private void RestoreOverflow() => ToolStripItem.Overflow = (ToolStripItemOverflow)ShadowProperties[nameof(Overflow)]; 1080private void ResetOverflow() => ToolStripItem.Overflow = ToolStripItemOverflow.AsNeeded; 1090private void RestoreAccessibleName() => ToolStripItem.AccessibleName = (string)ShadowProperties[nameof(AccessibleName)]; 1095if (ToolStripItem is ToolStripDropDownItem) 1105parent = ToolStripItem.Owner; 1108int currentIndex = parent.Items.IndexOf(ToolStripItem); 1152ToolStripItem.Visible = true; 1163ToolStripItem.Visible = _currentVisible; 1191if (ToolStripItem is ToolStripMenuItem) 1208Rectangle origBoundsInAdornerWindow = ToolStripItem.Bounds; 1210ToolStripItem.AutoSize = false; 1211_editorNode.SetWidth(ToolStripItem.Text); 1214ToolStripItem.Width = _editorNode.EditorToolStrip.Width + 2; 1218ToolStripItem.Height = _editorNode.EditorToolStrip.Height; 1227if (ToolStripItem.Placement != ToolStripItemPlacement.None) 1229Rectangle boundsInAdornerWindow = ToolStripItem.Bounds; 1236boundsInAdornerWindow.Y += (ToolStripItem.Height - _editorNode.EditorToolStrip.Height) / 2; 1241boundsInAdornerWindow.X += (ToolStripItem.Width - _editorNode.EditorToolStrip.Width) / 2; 1254parentDesigner.EditManager.ActivateEditor(ToolStripItem); 1265ToolStripItem.AutoSize = AutoSize; 1266if (ToolStripItem is ToolStripDropDownItem) // We have no place to show this item... so Hide the DropDown 1268if (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)