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

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

121 Examples 7

1. Example

Project: opentheatre
Source File: ctrlDetails.cs
View license
private void appClose_Click(object sender, EventArgs e)
        {
            frmOpenTheatre.form.tab.SelectedTab = frmOpenTheatre.form.currentTab;
            Parent.Controls.Clear();
        }

2. Example

Project: smuxi
Source File: Notebook.cs
View license
public void RemoveAllPages()
        {
            Controls.Clear();
        }

3. Example

View license
private void RemoveAllImages()
		{
			flpScreenshots.Controls.Clear();
		}

4. Example

Project: OKHOSTING.UI
Source File: ControlList.cs
View license
public void Clear()
		{
			InnerList.Clear();

		}

5. Example

Project: Legends-Viewer
Source File: DwarfTabPage.cs
View license
public void Close()
        {
            Current.Dispose();
            Controls.Clear();
        }

6. Example

Project: Legends-Viewer
Source File: LegendsViewer.cs
View license
private void RemoveEventFilterCheckBoxes()
        {
            foreach (TabPage eventTab in EventTabs)
                eventTab.Controls.Clear();
        }

7. Example

View license
public void Clear()
        {
            this.Controls.Clear();
        }

8. Example

Project: StackBuilder
Source File: UCtrlLayerList.cs
View license
private void Start()
        {
            // do not do anything when in design mode
            if (DesignMode)
                return;
            // clear all controls
            Controls.Clear();
            // start timer
            _index = 0; _x = 0; _y = 0;
            _timer.Interval = 50;
            _timer.Start();        
        }

9. Example

View license
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			string key = e.Node.FullPath;
			SettingsPage page = SettingsPages[key];
            Services.UserSettings.SaveSetting("Gui.Settings.InitialPage", key);

			if ( page != null && page != current )
			{
				panel1.Controls.Clear();
				panel1.Controls.Add( page );
				page.Dock = DockStyle.Fill;
				current = page;
				return;
			}
		}

10. Example

View license
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			string key = e.Node.FullPath;
			SettingsPage page = SettingsPages[key];
            Services.UserSettings.SaveSetting("Gui.Settings.InitialPage", key);

			if ( page != null && page != current )
			{
				panel1.Controls.Clear();
				panel1.Controls.Add( page );
				page.Dock = DockStyle.Fill;
				current = page;
				return;
			}
		}

11. Example

View license
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			string key = e.Node.FullPath;
			SettingsPage page = SettingsPages[key];
            Services.UserSettings.SaveSetting("Gui.Settings.InitialPage", key);

			if ( page != null && page != current )
			{
				panel1.Controls.Clear();
				panel1.Controls.Add( page );
				page.Dock = DockStyle.Fill;
				current = page;
				return;
			}
		}

12. Example

Project: NSMB-Editor
Source File: BinaryEdit.cs
View license
private void AddCheckBoxes() {
            this.Controls.Clear();
            int pos = 2;
            CheckBox cb;
            for (int l = 1; l <= _CheckBoxCount; l++) {
                cb = new CheckBox();
                cb.AutoSize = true;
                cb.Text = "";
                cb.Location = new Point(pos, 3);
                cb.CheckedChanged += new EventHandler(CheckBoxCheckedChanged);
                this.Controls.Add(cb);
                pos += 17;
            }
        }

13. Example

View license
public new void Dispose()
        {
            panelConditionType.Controls.Clear();
            Controls.Clear();
            textBoxCondition.Dispose();
            panelConditionType.Dispose();    
            base.Dispose();
        }

14. Example

Project: EDDiscovery
Source File: ActionPackEditorForm.cs
View license
public void Dispose()
            {
                panel.Controls.Clear();

                if (usercontrol != null)
                    usercontrol.Dispose();

                if (grouptype != null)
                    grouptype.Dispose();

                if (groupnamepanel != null)
                    groupnamepanel.Dispose();

                if (groupnamelabel != null)
                    groupnamelabel.Dispose();

                if (groupnamecollapsebutton != null)
                    groupnamecollapsebutton.Dispose();

                if (action != null)
                    action.Dispose();

                panel.Dispose();
            }

15. Example

View license
public new void Dispose()
        {
            Controls.Clear();
            proglist.Dispose();
            progedit.Dispose();
            paras.Dispose();
            base.Dispose();
        }

16. Example

Project: FAtiMA-Toolkit
Source File: FormHelper.cs
View license
public static void ShowFormInContainerControl(Control ctl, Form frm)
        {
            frm.MainMenuStrip.Visible = false;
            frm.TopLevel = false;
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.Dock = DockStyle.Fill;
            frm.Visible = true;
            ctl.Controls.Clear();
            ctl.Controls.Add(frm);
        }

17. Example

Project: HaSuite
Source File: PageCollection.cs
View license
private void TabPages_CurrentPageChanged(TabPage currentPage, TabPage previousPage)
        {
            this.SuspendPainting = true;
            this.PageContainer.Controls.Clear();
            if ((currentPage != null))
            {
                currentPage.Control.Dock = DockStyle.Fill;
                currentPage.Control.Visible = true;
                this.PageContainer.Controls.Add(currentPage.Control);
            }
            this.SuspendPainting = false;
        }

18. Example

Project: HaSuite
Source File: PageCollection.cs
View license
private void TabPages_PageRemoved(TabPage page)
        {
            if ((this.PageContainer.Contains(page.Control))) this.PageContainer.Controls.Clear();
            page.SetParent(null);
            page.TabPageCtl.OnClose -= OnPageClosing;
        }

19. Example

Project: JexusManager
Source File: WizardForm.cs
View license
protected virtual void OnPageChanged(EventArgs e)
        {
            if (CurrentPage == null)
            {
                return;
            }

            _txtTitle.Text = CurrentPage.Caption;
            _pnlContainer.Controls.Clear();
            _pnlContainer.Controls.Add(CurrentPage);
            CurrentPage.Activate();
        }

20. Example

View license
public void SetControl(Control ctrl)
		{
			Controls.Clear();
			if (m_acceptButton != null)
				Controls.Add(m_acceptButton);
			if (m_cancelButton != null)
				Controls.Add(m_cancelButton);
			
			Rectangle client = ClientRectangle;
			this.Width += ctrl.Width - client.Width;
			this.Height += ctrl.Height - client.Height;
			ctrl.Location = ClientRectangle.Location;
			Controls.Add(ctrl);

			ctrl.TabIndex = 0;
			m_acceptButton.TabIndex = 1;
			m_cancelButton.TabIndex = 2;
		}

21. Example

Project: NodeEditorWinforms
Source File: NodesControl.cs
View license
public void Clear()
        {
            graph.Nodes.Clear();
            graph.Connections.Clear();
            Controls.Clear();
            Refresh();
            rebuildConnectionDictionary = true;
        }

22. Example

Project: ACT.UltraScouter
Source File: PluginCore.cs
View license
private void SetupPluginTabPages(
            TabPage baseTabPage)
        {
            // ????????????????
            baseTabPage.Text = "ULTRA SCOUTER";

            baseTabPage.Controls.Clear();
            baseTabPage.Controls.Add(new ElementHost()
            {
                Child = new BaseView(),
                Dock = DockStyle.Fill,
            });
        }

23. Example

Project: anycmd
Source File: MainForm.cs
View license
private void mainTree_AfterSelect(object sender, TreeViewEventArgs e)
		{
			// Clear the main panel/n ..... /n //View Source file for more details /n }

24. Example

Project: anycmd
Source File: MainForm.cs
View license
private void menuItemClose_Click(object sender, System.EventArgs e)
		{
			_mainTree.Nodes.Clear();
			_mainPanel.Controls.Clear();
			_path = string.Empty;
			_menuItemOpenPolicy.Enabled = true;
			_menuItemOpenRequest.Enabled = true;
			_menuItemSaveAs.Enabled = false;
			_menuItemSave.Enabled = false;
			_menuItemRunRequest.Enabled = false;
			_menuItemRunPolicy.Enabled = false;
		}

25. Example

Project: mRemoteNG
Source File: PageSequence.cs
View license
private void ActivatePage(int sequenceNumber)
        {
            _pageContainer.Controls.Clear();
            _pageContainer.Controls.Add(_pages[sequenceNumber]);
        }

26. Example

Project: MvvmFx
Source File: ContentContainer.cs
View license
private void ResetContent()
        {
            Controls.Clear();
            _content = null;
            OnContentChanged(EventArgs.Empty);
        }

27. Example

View license
private void ClearForm()
        {
            if (_categoryControls.Count > 0)
            {
                categoryContainerControl.Controls.Clear();
                _categoryControls.Clear();
            }
        }

28. Example

Project: PokerMuck
Source File: CardListPanel.cs
View license
private void ClearCardPictures()
        {
            if (cardPictures.Count > 0) cardPictures.Clear();
            this.Controls.Clear();
        }

29. Example

Project: PokerMuck
Source File: ControlListContainer.cs
View license
public void ClearAll()
        {
            Controls.Clear();
            maxHeightTable.Clear();
        }

30. Example

View license
private void RemoveStatistics(PlayerStatistics statistics)
        {
            // For each statistic category
            foreach (String category in statistics.GetCategories())
            {
                // Find the tab page for this category
                TabPage tp = FindTabPage(category);

                // Clear it
                tp.Controls.Clear();
            }
        }

31. Example

Project: poderosa
Source File: PaneDivision.cs
View license
public void ClearControlTree() {
                if (_hostingControl != null)
                    _hostingControl.Controls.Clear();
                _first.ClearControlTree();
            }

32. Example

Project: GEDKeeper
Source File: GKPortrait.cs
View license
private void RedrawButtons()
        {
            int lenwagon = 0;

            btnPanel.Controls.Clear();

            for (int i = 0, c = fBtnsList.Count; i < c; i++)
            {
                lenwagon += (i > 0) ? (8 + fBtnsList[i].Width) : fBtnsList[i].Width;
            }

            int center = lenwagon / 2;
            int startPosition = btnPanel.Width / 2 - center;

            for (int i = 0, c = fBtnsList.Count; i < c; i++)
            {
                int heightCenter = btnPanel.Height / 2;
                int btnCenter = fBtnsList[i].Height / 2;

                fBtnsList[i].Location = new Point(startPosition, heightCenter - btnCenter);
                btnPanel.Controls.Add(fBtnsList[i]);
                startPosition += fBtnsList[i].Width + 8;
            }
        }

33. Example

Project: tgc-viewer
Source File: TgcModifiers.cs
View license
public void Clear()
        {
            modifiersPanel.Controls.Clear();
            modifiers.Clear();
        }

34. Example

View license
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			string key = e.Node.FullPath;
			SettingsPage page = SettingsPages[key];
            Services.UserSettings.SaveSetting("Gui.Settings.InitialPage", key);

			if ( page != null && page != current )
			{
				panel1.Controls.Clear();
				panel1.Controls.Add( page );
				page.Dock = DockStyle.Fill;
				current = page;
				return;
			}
		}

35. Example

View license
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			string key = e.Node.FullPath;
			SettingsPage page = SettingsPages[key];
            Services.UserSettings.SaveSetting("Gui.Settings.InitialPage", key);

			if ( page != null && page != current )
			{
				panel1.Controls.Clear();
				panel1.Controls.Add( page );
				page.Dock = DockStyle.Fill;
				current = page;
				return;
			}
		}

36. Example

View license
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			string key = e.Node.FullPath;
			SettingsPage page = SettingsPages[key];
            Services.UserSettings.SaveSetting("Gui.Settings.InitialPage", key);

			if ( page != null && page != current )
			{
				panel1.Controls.Clear();
				panel1.Controls.Add( page );
				page.Dock = DockStyle.Fill;
				current = page;
				return;
			}
		}

37. Example

Project: 0install-win
Source File: AppTileList.cs
View license
public void Clear()
        {
            _appTileQueue.Clear();
            _appTileQueueHeight = 0;

            _flowLayout.Controls.Clear();
            _flowLayout.Height = 0;

            _tileDictionary.Clear();
            _lastTileLight = false;
        }

38. Example

Project: dp2
Source File: ControlExtensions.cs
View license
public static void ClearControls(this Control parent,
            bool bDispose = false)
        {
            if (parent.Controls.Count == 0)
                return;

            List<Control> controls = new List<Control>();
            foreach (Control control in parent.Controls)
            {
                controls.Add(control);
            }

            parent.Controls.Clear();
            if (bDispose)
            {
                foreach (Control control in controls)
                {
                    control.Dispose();
                }
            }
        }

39. Example

View license
private void Del_Clicked(object sender, EventArgs e)
        {
            ExtendedControls.ButtonExt b = sender as ExtendedControls.ButtonExt;
            Group g = (Group)b.Tag;

            g.panel.Controls.Clear();
            panelVScroll1.Controls.Remove(g.panel);
            groups.Remove(g);
            Invalidate(true);
            FixUpGroups();
        }

40. Example

View license
private void initSideDrawer()
        {
            bool LastControlWasDivider = false;
            /n ..... /n //View Source file for more details /n }

41. Example

Project: Histacom2
Source File: Game.cs
View license
public void Start()
        {

            //Panel.SuspendLayout();
            Time = 0;
            _dismantledMines = 0;
            _incorrectdismantledMines = 0;
            Panel.Enabled = true;
            Panel.Controls.Clear();

            // Create Spots
            _squares = new Square[Width, Height];
            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    Square s = new Square(this, x, y);
                    s.Explode += new EventHandler(Explode);
                    s.Dismantle += new EventHandler(Dismantle);
                    s.Button.MouseDown += (send, args) => { if (_panel.Enabled) _window.button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperGasp; };
                    s.Button.MouseUp += (send, args) => { if (_panel.Enabled) _window.button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperSmile; };
                    _squares[x, y] = s;
                }
            }

            // Place Mines
            int b = 0;
            Random r = new Random();
            while (b < Mines)
            {
                int x = r.Next(Width);
                int y = r.Next(Height);

                Square s = _squares[x, y];
                if (!s.Minded)
                {
                    s.Minded = true;
                    b++;
                }
            }

            OnDismantledMinesChanged();
        }

42. Example

Project: VhdAttach
Source File: Upgrade [004].cs
View license
protected override void Dispose(bool disposing) {
                if (disposing) {
                    foreach (Control iControl in this.Controls) {
                        iControl.Dispose();
                    }
                    this.bwCheck.Dispose();
                    this.bwDownload.Dispose();
                    this.Controls.Clear();
                }
                base.Dispose(disposing);
            }

43. Example

Project: anycmd
Source File: TargetItem.cs
View license
private void button1_Click(object sender, System.EventArgs e)
        {
            LoadingData = true;
            for (int index = 0; index < _list.Count; index++)
            {
                _targetItem.Match[index] = ((CustomControls.Match)_list[index]).MatchElement;
            }

            LoadingData = false;
            ModifiedValue = false;

            lstMatch.Items.Clear();
            foreach (TargetMatchBaseReadWrite match in _targetItem.Match)
            {
                lstMatch.Items.Add(match);
            }
            mainPanel.Controls.Clear();
        }

44. Example

Project: anycmd
Source File: TargetItem.cs
View license
private void btnRemove_Click(object sender, System.EventArgs e)
        {
            LoadingData = true;
            _list.Remove(lstMatch.SelectedIndex);
            _targetItem.Match.RemoveAt(lstMatch.SelectedIndex);
            lstMatch.Items.RemoveAt(lstMatch.SelectedIndex);
            mainPanel.Controls.Clear();
            LoadingData = false;
            index = -1;
        }

45. Example

Project: Urbanization
Source File: MainForm.cs
View license
private void RegisterAreaRenderHelper(TerraformingOptions terraformingOptions = null, PersistedSimul/n ..... /n //View Source file for more details /n }

46. Example

Project: Tibialyzer
Source File: MainForm.cs
View license
private void InitializeTabs() {
            Tabs = new List<TabInterface> { new MainTab(), new SettingsTab(), new HuntsTab(), new LogsTab(), new NotificationsTab(), new PopupsTab(), new DatabaseTab(), new AutoHotkeyTab(), new ScreenshotTab(), new BrowseTab(), new HelpTab(), new SystemTab(), new SummaryTab(), new HUDTab(), new HealthListTab(), new PortraitTab(), new AdvancedTab(), new AboutTab(), new TaskTab(), new Outfiter() };
            foreach (TabInterface tab in Tabs) {
                List<Control> controlList = new List<Control>();
                foreach (Control c in (tab as Form).Controls) {
                    controlList.Add(c);
                    c.Location = new Point(c.Location.X + mainButton.Location.X + mainButton.Width + 4, c.Location.Y + 24);
                    StyleManager.InitializeElement(c);
                    StyleManager.StyleElement(c);
                }
                (tab as Form).Controls.Clear();
                tabControls.Add(controlList);
            }

            foreach(Control c in this.Controls) {
                StyleManager.InitializeElement(c);
                StyleManager.StyleElement(c);
            }

            // Manually add controls that appear on multiple pages
            tabControls[3].Add((Tabs[2] as HuntsTab).GetHuntList());
            tabControls[3].Add((Tabs[2] as HuntsTab).GetHuntLabel());
        }

47. Example

Project: OpenLiveWriter
Source File: InsertImageDialog.cs
View license
public void SetActiveControl(InsertImageSource source)
        {
            //if coming from file tab, hide all that stuff
            if (state != STATE.WEB)
            {
                foreach (IntPtr thing in controlsToShowHideOnTabSwitch)
                {
                    User32.ShowWindow(thing, SW.HIDE);
                }
            }

            //set the new source info
            activeImageSource = source;
            _panelImage.Controls.Clear();
            _panelImage.Controls.Add(activeImageSource.ImageSelectionControls);
            ManipulatePanels();
            _panelImage.Visible = true;
            activeImageSource.TabSelected();

            state = STATE.WEB;
        }

48. Example

Project: poderosa
Source File: PaneDivision.cs
View license
public void ClearControlTree() {
                if (_intermediateContainer != null)
                    _intermediateContainer.Controls.Clear();
                if (_next != null)
                    _next.ClearControlTree();
                if (!this.IsLeaf)
                    _childList.ClearControlTree();
            }

49. Example

Project: Sardauscan
Source File: HardwareStatusControl.cs
View license
private void ClearSettingsPanel()
		{
			IDisposable disp = SettingsPanel.Controls.Count > 0 ? SettingsPanel.Controls[0] as IDisposable : null;
			SettingsPanel.Controls.Clear();
			if (disp != null)
				disp.Dispose();
			SettingsPanel.Height = 0;
			this.HideSettings.Visible = false;
			NotifyChange();
		}

50. Example

Project: MaxLifx
Source File: SoundGeneratorUI.cs
View license
private void ClearPanel(Control control)
        {
            foreach (Control c in control.Controls)
            {
                if (c.GetType() == typeof (Button)) ((Button) c).Click -= StopStart;
                if (c.GetType() == typeof (TrackBar)) ((TrackBar) c).ValueChanged -= VolumeChanged;
                c.Dispose();
            }

            control.Controls.Clear();
        }