System.Windows.Forms.ToolStripItemCollection.Remove C# (CSharp) Méthode

Remove() public méthode

public Remove ( ToolStripItem value ) : void
value ToolStripItem
Résultat void
		public void Remove (ToolStripItem value)
		{
			if (this.IsReadOnly)
				throw new NotSupportedException ("This collection is read-only");

			base.Remove (value);
			
			if (value != null && internal_created) {
				value.InternalOwner = null;
				value.Parent = null;
			}
			
			if (internal_created)
				owner.OnItemRemoved (new ToolStripItemEventArgs (value));
			
			if (owner.Created)	
				owner.PerformLayout ();
		}

Usage Example

Exemple #1
0
 public override void InitializeBackend(object frontend, ApplicationContext context)
 {
     base.InitializeBackend(frontend, context);
     Menu                      = new SWF.MenuStrip();
     ItemsCollection           = Menu.Items;
     _items.CollectionChanged += (sender, args) => {
         var backend = args.NewItems.Cast <MenuItemBackend> ().FirstOrDefault();
         if (args.Action == NotifyCollectionChangedAction.Add)
         {
             ItemsCollection.Insert(args.NewStartingIndex, backend.MenuItem);
         }
         if (args.Action == NotifyCollectionChangedAction.Remove)
         {
             ItemsCollection.Remove(backend.MenuItem);
         }
     };
 }
All Usage Examples Of System.Windows.Forms.ToolStripItemCollection::Remove