System.Windows.Forms.Control.ControlCollection.Remove(System.Windows.Forms.Control)

Here are the examples of the csharp api class System.Windows.Forms.Control.ControlCollection.Remove(System.Windows.Forms.Control) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: Krypton
Source File: KryptonControlCollection.cs
View license
[Browsable(false)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public void RemoveInternal(Control control)
        {
            base.Remove(control);
        }

2. Example

Project: VisualPlus
Source File: VisualBadge.cs
View license
private void Remove()
        {
            if (_badgeLabel != null)
            {
                _control.Controls.Remove(_badgeLabel);
            }
        }

3. Example

Project: VisualPlus
Source File: VisualTextBox.cs
View license
private void RemoveWaterMark()
        {
            if (_waterMarkContainer != null)
            {
                _textBox.Controls.Remove(_waterMarkContainer);
                _waterMarkContainer = null;
            }
        }

4. Example

View license
void ClearOneItemControls(
            TableLayoutPanel table,
            Item line)
        {
            table.Controls.Remove(line.label);

            if (line.textBox != null)
                table.Controls.Remove(line.textBox);

            if (line.comboBox != null)
                table.Controls.Remove(line.comboBox);
        }

5. Example

Project: moddingSuite
Source File: Icon.cs
View license
public override void detachFrom(System.Windows.Forms.Control c)
        {
            c.Controls.Remove(position);
            c.Paint -= paintEvent;
        }

6. Example

Project: moddingSuite
Source File: Spawn.cs
View license
public override void detachFrom(System.Windows.Forms.Control c)
        {
            c.Controls.Remove(head);
            c.Controls.Remove(source);
            c.Paint -= paintEvent;
        }

7. Example

Project: moddingSuite
Source File: Zone.cs
View license
public override void detachFrom(Control c)
        {
            c.Paint -= paintEvent;
            c.Controls.Remove(attachPoint);
            outline.detachFrom(c);
            
        }

8. Example

Project: moddingSuite
Source File: Outline.cs
View license
public void detachFrom(Control c)
        {
            
            parent.Paint -= paintEvent;
            foreach (var m in markers)
            {
                c.Controls.Remove(m);
            }
            foreach (var cr in creaters)
            {
                c.Controls.Remove(cr);
            }
            this.parent = null;
        }

9. Example

Project: fomm
Source File: PanelToolStrip.cs
View license
public void removeToolStripItem(PanelToolStripItem p_pdiItem)
      {
        p_pdiItem.Selected -= psiButton_Selected;
        Controls.Remove(p_pdiItem.Button);
      }

10. Example

Project: fomm
Source File: VerticalTabControl.cs
View license
private void RemoveTabPage(object sender, TabPageEventArgs e)
    {
      var ctlPage = e.TabPage;
      ctlPage.TabButton.Selected -= TabSelected;
      foreach (var tabPage in TabPages)
      {
        if (tabPage.PageIndex > ctlPage.PageIndex)
        {
          tabPage.PageIndex--;
        }
      }
      m_ptsTabContainer.removeToolStripItem(ctlPage.TabButton);
      if (SelectedTabPage == ctlPage)
      {
        if (TabPages.Count == 0)
        {
          SelectedTabPage = null;
        }
        else if (SelectedIndex == TabPages.Count)
        {
          SelectedIndex--;
        }
        else
        {
          SelectedIndex++;
        }
      }
      Controls.Remove(e.TabPage);
    }

11. Example

Project: mbunit-v3
Source File: EmbeddedControl.cs
View license
public void Hide()
            {
                parentControl.Controls.Remove(embeddedControl.Control);
            }

12. Example

View license
public void CloseSearchBar()
        {
            if (searchOpen)
            {
                objAnimationManager.StartNewAnimation(AnimationDirection.Out);
                SearchTextBox.Text = "";
                searchOpen = false;
                Controls.Remove(SearchTextBox);
            }
        }

13. Example

Project: IceChat
Source File: FormFloat.cs
View license
private void FormFloat_FormClosing(object sender, FormClosingEventArgs e)
        {
            _parentForm.SetPanel(ref this._panel, this.Location, _tabName);
            this.Controls.Remove(_panel);
        }

14. Example

Project: bedrock
Source File: Region.cs
View license
public override void Remove(IView view)
        {
            base.Remove(view);
            var castedView = view as Control;
            var container = Control as Control;
            if (castedView != null && container != null)
            {
                container.Controls.Remove(castedView);
            }
        }

15. Example

View license
void btnPicClose_Click(object sender, EventArgs e)
        {
            btnPicClose.Visible =false;
            Controls.Remove(panel);
            panel = null;
            btnPicMenu.Visible =true;
            btnPicProfile.Visible =true;
            locationPanel1.Visible=true;
        }

16. Example

View license
private void Cleanup()
      {
         foreach ( DotControl dc in _dotControls )
         {
            Controls.Remove( dc );
            dc.Dispose();
         }

         foreach ( FieldControl fc in _fieldControls )
         {
            Controls.Remove( fc );
            fc.Dispose();
         }

         _dotControls = null;
         _fieldControls = null;
      }

17. Example

View license
private void Cleanup()
      {
         foreach ( DotControl dc in _dotControls )
         {
            Controls.Remove( dc );
            dc.Dispose();
         }

         foreach ( FieldControl fc in _fieldControls )
         {
            Controls.Remove( fc );
            fc.Dispose();
         }

         _dotControls = null;
         _fieldControls = null;
      }

18. Example

View license
private void Cleanup()
    {
      foreach (DotControl dc in _dotControls)
      {
        Controls.Remove(dc);
        dc.Dispose();
      }

      foreach (FieldControl fc in _fieldControls)
      {
        Controls.Remove(fc);
        fc.Dispose();
      }

      _dotControls = null;
      _fieldControls = null;
    }

19. Example

View license
private void Cleanup()
    {
      if (_dotControls != null)
      {
        foreach (DotControl dc in _dotControls)
        {
          Controls.Remove(dc);
          dc.Dispose();
        }
        _dotControls = null;
      }

      if (_fieldControls != null)
      {
        foreach (FieldControl fc in _fieldControls)
        {
          Controls.Remove(fc);
          fc.Dispose();
        }
        _fieldControls = null;
      }
    }

20. Example

View license
private void RemoveTextEditor(TextEditorControl editor)
		{
			((TabControl)editor.Parent.Parent).Controls.Remove(editor.Parent);
		}

21. Example

Project: MultiversePlatform
Source File: Importer.cs
View license
internal void RemoveControls(Form form) 
			{
                form.Controls.Remove(label);
                form.Controls.Remove(button);
				form.Controls.Remove(useTextBox ? (Control)textBox : (Control)listBox);
			}

22. Example

View license
public void Remove(IFrameControl frame)
		{
			this.parent.Controls.Remove((Control)frame);
		}

23. Example

View license
private void Panel_ControlAdded(object sender, ControlEventArgs e)
		{
			if (!(e.Control is GameModeListViewItemBase))
				Controls.Remove(e.Control);
			else
			{
				e.Control.AutoSize = false;
				e.Control.Dock = DockStyle.Fill;
				e.Control.MinimumSize = e.Control.PreferredSize;
			}
		}

24. Example

Project: Nexus-Mod-Manager
Source File: PanelToolStrip.cs
View license
public void removeToolStripItem(PanelToolStripItem p_pdiItem)
			{
				p_pdiItem.Selected -= new EventHandler<EventArgs>(psiButton_Selected);
				Controls.Remove(p_pdiItem.Button);
			}

25. Example

View license
private void RemoveTabPage(object sender, VerticalTabControl.TabPageEventArgs e)
		{
			VerticalTabPage ctlPage = e.TabPage;
			ctlPage.TabButton.Selected -= TabSelected;
			for (Int32 i = 0; i < m_tpcPages.Count; i++)
				if (m_tpcPages[i].PageIndex > ctlPage.PageIndex)
					m_tpcPages[i].PageIndex--;
			m_ptsTabContainer.removeToolStripItem(ctlPage.TabButton);
			if (SelectedTabPage == ctlPage)
			{
				if (m_tpcPages.Count == 0)
					SelectedTabPage = null;
				else if (SelectedIndex == m_tpcPages.Count)
					SelectedIndex--;
				else
					SelectedIndex++;
			}
			Controls.Remove(e.TabPage);
		}

26. Example

Project: LaserGRBL
Source File: PlaceholderTextbox.cs
View license
private void RemoveWaterMark()
		{
			if (waterMarkContainer != null)
			{
				this.Controls.Remove(waterMarkContainer);
				waterMarkContainer = null;
			}
		}

27. Example

Project: OKHOSTING.UI
Source File: ControlList.cs
View license
public bool Remove(IControl item)
		{
			InnerList.Remove((Native.Control) item);

			return true;
		}

28. Example

Project: OpenLiveWriter
Source File: ContentEditor.cs
View license
private void UnregisterEditor(IBlogPostHtmlEditor editor)
        {
            editor.CommandSource.CommandStateChanged -= new EventHandler(editor_CommandStateChanged);
            editor.CommandSource.AggressiveCommandStateChanged -= new EventHandler(editor_AggressiveCommandStateChanged);
            editor.IsDirtyEvent -= new EventHandler(editor_IsDirtyEvent);
            _editorContainer.Controls.Remove(editor.EditorControl);
        }

29. Example

Project: ecsharp
Source File: LempDemoForm.cs
View license
private void RemoveTextEditor(LempDemoPanel panel)
		{
			((TabControl)panel.Parent.Parent).Controls.Remove(panel.Parent);
		}

30. Example

Project: Repetier-Host
Source File: InfoProgressPanel.cs
View license
public void Finished()
        {
            if (Parent != null)
                Parent.Controls.Remove(this);
            timer.Stop();
        }

31. Example

View license
private void Remove_OnClick(object sender, EventArgs e)
        {
            Parent.Controls.Remove(this);
        }

32. Example

Project: FEFTwiddler
Source File: ConvoyItemPanel.cs
View license
private void RemoveThisItem()
        {
            _chapterSave.ConvoyRegion.Convoy.Remove(_item);
            Utils.WeaponNameUtil.RemoveWeaponNameIfUnused(_chapterSave, _item.WeaponNameID);
            ConvoyMain.GetFromHere(this).UpdateConvoyCount();

            this.Parent.Controls.Remove(this);
        }

33. Example

Project: vimage
Source File: CustomActionItem.cs
View license
private void button_Delete_Click(object sender, EventArgs e)
        {
            int index = ConfigWindow.CustomActionItems.IndexOf(this);

            int scrollValue = ConfigWindow.GetContextMenuPanelScrollValue();
            ConfigWindow.CustomActionItems.Remove(this);
            Parent.Controls.Remove(this);
            ConfigWindow.RefreshCustomAcionItems(scrollValue);
        }

34. Example

Project: LiteDevelop
Source File: ControlManager.cs
View license
private void toolBars_RemovedItem(object sender, CollectionChangedEventArgs e)
        {
            ToolStripPanel.Controls.Remove(e.TargetObject as ToolStrip);
        }

35. Example

Project: BloomDesktop
Source File: AdobeReaderControl.cs
View license
private void FormClosing(object sender, FormClosingEventArgs e)
		{
			if (_adobeReader != null)
			{
				// This purposely SUPPRESSES the Dispose of _adobeReader that otherwise automatically happens
				// as the window shuts down. For some reason Dispose of this object is VERY slow; around 16 seconds
				// on my fast desktop. I don't think it can hang on to any important resources once the app
				// quits, so just prevent the Dispose.
				// (I tried various other things, such as loading a non-existent file and catching the resulting
				// exception, hiding the _adobeReader, Disposing it in advance (in this method)...nothing else
				// prevented the long delay on shutdown.)
				this.Controls.Remove(_adobeReader);
				_adobeReader = null;
			}
		}

36. Example

Project: ClearCanvas
Source File: ImageBoxControl.cs
View license
private void DisposeControls(IEnumerable<TileControl> controls)
		{
			foreach (TileControl control in controls)
			{
				this.Controls.Remove(control);
				control.MouseMove -= OnTileMouseMove;
				control.Tile.SelectionChanged -= OnTileSelectionChanged;
				control.Drawing -= OnTileControlDrawing;
				control.Dispose();
			}
		}

37. Example

Project: alphaTab
Source File: AlphaTabControl.cs
View license
protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            if (e.Control != _layoutPanel)
            {
                Controls.Remove(e.Control);
            }
        }

38. Example

Project: Krypton
Source File: CommonHelper.cs
View license
public static void RemoveControlFromParent(Control c)
        {
            Debug.Assert(c != null);

            // If the control is inside a parent collection
            if (c.Parent != null)
            {
                // If the control collection is one of our internal collections...
                if (c.Parent.Controls is KryptonControlCollection)
                {
                    // Then must use the internal method for adding a new instance
                    KryptonControlCollection cc = (KryptonControlCollection)c.Parent.Controls;
                    cc.RemoveInternal(c);
                }
                else
                {
                    // Inside a standard collection, remove it the usual way
                    c.Parent.Controls.Remove(c);
                }
            }
        }

39. Example

Project: TaskScheduler
Source File: CustomComboBox.cs
View license
protected virtual void AssignControl(Control control)
		{
			// If specified control is different then...
			if (control != m_dropDownCtrl)
			{
				// Preserve original container size.
				m_sizeOriginal = control.Size;

				// Reference the user-specified drop down control.
				m_dropDownCtrl = control;

				Controls.Remove(m_dropDownCtrl);
				Controls.Add(control);
			}
		}

40. Example

Project: dockpanelsuite
Source File: DockPanel.cs
View license
internal void ResetDockWindows()
        {
            if (m_autoHideWindow == null)
            {
                return;
            }

            var old = m_dockWindows;
            LoadDockWindows();
            foreach (var dockWindow in old)
            {
                Controls.Remove(dockWindow);
                dockWindow.Dispose();
            }
        }

41. Example

Project: DotSpatial
Source File: Paging.cs
View license
public void ResetButtons(TabPage tab)
        {
            foreach (var button in _listOfButtons)
            {
                tab.Controls.Remove(button);
            }

            _listOfButtons.Clear();
        }

42. Example

Project: EvilFOCA
Source File: ListViewEx.cs
View license
public void RemoveEmbeddedControl(Control c)
        {
            if (c == null)
                throw new ArgumentNullException();

            for (int i = 0; i < _embeddedControls.Count; i++)
            {
                EmbeddedControl ec = (EmbeddedControl)_embeddedControls[i];
                if (ec.Control == c)
                {
                    c.Click -= new EventHandler(_embeddedControl_Click);
                    this.Controls.Remove(c);
                    _embeddedControls.RemoveAt(i);
                    return;
                }
            }
            //throw new Exception("Control not found!");
        }

43. Example

Project: FOCA
Source File: ListViewEx.cs
View license
public void RemoveEmbeddedControl(Control c)
		{
			if (c == null)
				throw new ArgumentNullException();

			for (int i=0; i<_embeddedControls.Count; i++)
			{
				EmbeddedControl ec = (EmbeddedControl)_embeddedControls[i];
				if (ec.Control == c)
				{
					c.Click -= new EventHandler(_embeddedControl_Click);
					this.Controls.Remove(c);
					_embeddedControls.RemoveAt(i);
					return;
				}
			}
		}

44. Example

Project: fomm
Source File: DropDownTabControl.cs
View license
private void RemoveTabPage(object sender, TabPageEventArgs e)
    {
      var ctlPage = e.TabPage;
      ctlPage.PageIndexChanged -= PageIndexChanged;
      ctlPage.TextChanged -= PageTextChanged;
      TabSelector.Items.Remove(ctlPage);
      foreach (var page in TabPages)
      {
        if (page.PageIndex > ctlPage.PageIndex)
        {
          page.PageIndex--;
        }
      }
      if (SelectedTabPage == ctlPage)
      {
        if (TabPages.Count == 0)
        {
          SelectedTabPage = null;
        }
        else if (SelectedIndex == TabPages.Count)
        {
          SelectedIndex--;
        }
        else
        {
          SelectedIndex++;
        }
      }
      Controls.Remove(e.TabPage);
    }

45. Example

Project: bjd5
Source File: CtrlTabPage.cs
View license
protected override void AbstractDelete(){
            foreach (var onePage in PageList){
                onePage.ListVal.DeleteCtrl(); //??????????????????????????????????
            }

            while (_pagePanelList.Count != 0){
                _tabControl.Controls.Remove(_pagePanelList[0]); //??????
                _pagePanelList.RemoveAt(0); // ???????
            }
            _pagePanelList = null;

            Remove(Panel, _tabControl);
            _tabControl = null;
        }

46. Example

Project: bjd5
Source File: OneCtrl.cs
View license
protected void Remove(Control palent, Control self){
            if (self != null){
                _controlCounter--;
                if (palent != null){
                    // owner?null?????????????????
                    palent.Controls.Remove(self);
                    self.Dispose();
                }
            }
            //RemoveListener(); // ?????????
        }

47. Example

Project: MaterialWinforms
Source File: DropDownControl.cs
View license
public void InitializeDropDown(Control dropDownItem)
        {
            if (_dropDownItem != null)
                throw new Exception("The drop down item has already been implemented!");
            _DesignView = false;
            _dropState = eDropState.Closed;
            this.Size = _AnchorSize;
            this._AnchorClientBounds = new Rectangle(2, 2, _AnchorSize.Width - 21, _AnchorSize.Height - 4);
            //removes the dropDown item from the controls list so it 
            //won't be seen until the drop-down window is active
            if (this.Controls.Contains(dropDownItem))
                this.Controls.Remove(dropDownItem);
            _dropDownItem = dropDownItem;
        }

48. Example

Project: ArnoldSimulator
Source File: DockPanel.cs
View license
internal void ReloadDockWindows()
        {
            var old = m_dockWindows;
            LoadDockWindows();
            foreach (var dockWindow in old)
            {
                Controls.Remove(dockWindow);
                dockWindow.Dispose();
            }
        }

49. Example

Project: IceChat
Source File: IceDockPanel.cs
View license
public void UnDockPanel(Panel p)
        {
            if (p.Parent.GetType() == typeof(TabPage))
            {
                //remove the tab from the tabStrip
                TabPage tp = (TabPage)p.Parent;
                _tabControl.TabPages.Remove((TabPage)p.Parent);
                ((TabPage)p.Parent).Controls.Remove(p);

                if (_tabControl.TabPages.Count == 0)
                {
                    //hide the splitter bar along with the panel
                    if (this.Dock == DockStyle.Left)
                        FormMain.Instance.splitterLeft.Visible = false;
                    else
                        FormMain.Instance.splitterRight.Visible = false;

                    this.Visible = false;
                }

                FormFloat formFloat = new FormFloat(ref p, FormMain.Instance, tp.Text);
                formFloat.Show();
                formFloat.Left = Cursor.Position.X - (formFloat.Width / 2);
                formFloat.Top = Cursor.Position.Y;
            }
        }

50. Example

Project: 32feet
Source File: RemoteControlForm.cs
View license
private void mnuConnect_Click(object sender, System.EventArgs e)
		{
			if(cmbDevices.SelectedValue != null)
			{
				try
				{
					bc.Connect(new BluetoothEndPoint((BluetoothAddress)cmbDevices.SelectedValue, service)); 
					mnuConnect.Enabled = false;
					this.Controls.Remove(cmbDevices);
					this.BackColor = Color.PaleGreen;
					this.Focus();
				}
				catch
				{
					//error connecting
					this.BackColor = Color.Salmon;
				}
			}
		}