System.Windows.Forms.ToolStripItemCollection.Clear C# (CSharp) Method

Clear() public method

public Clear ( ) : void
return void
		public new virtual void Clear ()
		{
			if (this.IsReadOnly)
				throw new NotSupportedException ("This collection is read-only");

			if (internal_created)
				foreach (ToolStripItem item in this) {
					item.InternalOwner = null;
					item.Parent = null;
				}

			base.Clear ();
			owner.PerformLayout ();
		}

Usage Example

コード例 #1
0
        public static void Sort(ToolStripItemCollection collection, IComparer comparer)
        {
            ArrayList items = new ArrayList(collection);
            items.Sort(comparer);

            collection.Clear();
            foreach (object itm in items)
                collection.Add(itm as ToolStripItem);
        }
All Usage Examples Of System.Windows.Forms.ToolStripItemCollection::Clear