System.Windows.Forms.ToolStrip.Dispose C# (CSharp) Method

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
		protected override void Dispose (bool disposing)
		{
			if (!IsDisposed) {
				//CloseToolTip (null);
				// ToolStripItem.Dispose modifes the collection,
				// so we iterate it in reverse order
				for (int i = Items.Count - 1; i >= 0; i--)
					Items [i].Dispose ();
					
				//if (this.overflow_button != null && this.overflow_button.drop_down != null)
				//	this.overflow_button.drop_down.Dispose ();

				//ToolStripManager.RemoveToolStrip (this);
				base.Dispose (disposing);
			}
		}
		

Usage Example

Example #1
0
        public override void CloseTabPage()
        {
            //this.Controls.Clear();

            base.CloseTabPage();
            //this.drawarea.CloseDrawArea();

            //panelPageNavigation = null;
            //toolStripPageNavigation = null;
            //toolStripButtonAdd = null;
            //toolStripButtonDelete = null;
            //toolStripSeparator1 = null;
            //toolStripButtonFirst = null;
            //toolStripButtonPrevious = null;
            //toolStripLabelPageNumber = null;
            //toolStripButtonNext = null;
            //toolStripButtonLast = null;
            //drawarea = null;
            //panelTabPage = null;
            panelPageNavigation.Dispose();

            toolStripPageNavigation.Dispose();
            toolStripButtonAdd.Dispose();
            toolStripButtonDelete.Dispose();
            toolStripSeparator1.Dispose();
            toolStripButtonFirst.Dispose();
            toolStripButtonPrevious.Dispose();
            toolStripLabelPageNumber.Dispose();
            toolStripButtonNext.Dispose();
            toolStripButtonLast.Dispose();

            //drawarea = null;
        }
All Usage Examples Of System.Windows.Forms.ToolStrip::Dispose