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
0
1. Example
View licenseprivate void appClose_Click(object sender, EventArgs e) { frmOpenTheatre.form.tab.SelectedTab = frmOpenTheatre.form.currentTab; Parent.Controls.Clear(); }
0
0
0
0
0
6. Example
View licenseprivate void RemoveEventFilterCheckBoxes() { foreach (TabPage eventTab in EventTabs) eventTab.Controls.Clear(); }
0
0
8. Example
View licenseprivate 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(); }
0
9. Example
View licenseprivate 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; } }
0
10. Example
View licenseprivate 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; } }
0
11. Example
View licenseprivate 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; } }
0
12. Example
View licenseprivate 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; } }
0
13. Example
View licensepublic new void Dispose() { panelConditionType.Controls.Clear(); Controls.Clear(); textBoxCondition.Dispose(); panelConditionType.Dispose(); base.Dispose(); }
0
14. Example
View licensepublic 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(); }
0
15. Example
View licensepublic new void Dispose() { Controls.Clear(); proglist.Dispose(); progedit.Dispose(); paras.Dispose(); base.Dispose(); }
0
16. Example
View licensepublic 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); }
0
17. Example
View licenseprivate 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; }
0
18. Example
View licenseprivate void TabPages_PageRemoved(TabPage page) { if ((this.PageContainer.Contains(page.Control))) this.PageContainer.Controls.Clear(); page.SetParent(null); page.TabPageCtl.OnClose -= OnPageClosing; }
0
19. Example
View licenseprotected virtual void OnPageChanged(EventArgs e) { if (CurrentPage == null) { return; } _txtTitle.Text = CurrentPage.Caption; _pnlContainer.Controls.Clear(); _pnlContainer.Controls.Add(CurrentPage); CurrentPage.Activate(); }
0
20. Example
View licensepublic 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; }
0
21. Example
View licensepublic void Clear() { graph.Nodes.Clear(); graph.Connections.Clear(); Controls.Clear(); Refresh(); rebuildConnectionDictionary = true; }
0
22. Example
View licenseprivate void SetupPluginTabPages( TabPage baseTabPage) { // ???????????????? baseTabPage.Text = "ULTRA SCOUTER"; baseTabPage.Controls.Clear(); baseTabPage.Controls.Add(new ElementHost() { Child = new BaseView(), Dock = DockStyle.Fill, }); }
0
23. Example
View licenseprivate void mainTree_AfterSelect(object sender, TreeViewEventArgs e) { // Clear the main panel/n ..... /n //View Source file for more details /n }
0
24. Example
View licenseprivate 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; }
0
25. Example
View licenseprivate void ActivatePage(int sequenceNumber) { _pageContainer.Controls.Clear(); _pageContainer.Controls.Add(_pages[sequenceNumber]); }
0
26. Example
View licenseprivate void ResetContent() { Controls.Clear(); _content = null; OnContentChanged(EventArgs.Empty); }
0
27. Example
View licenseprivate void ClearForm() { if (_categoryControls.Count > 0) { categoryContainerControl.Controls.Clear(); _categoryControls.Clear(); } }
0
28. Example
View licenseprivate void ClearCardPictures() { if (cardPictures.Count > 0) cardPictures.Clear(); this.Controls.Clear(); }
0
0
30. Example
View licenseprivate 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(); } }
0
31. Example
View licensepublic void ClearControlTree() { if (_hostingControl != null) _hostingControl.Controls.Clear(); _first.ClearControlTree(); }
0
32. Example
View licenseprivate 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; } }
0
0
34. Example
View licenseprivate 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; } }
0
35. Example
View licenseprivate 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; } }
0
36. Example
View licenseprivate 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; } }
0
37. Example
View licensepublic void Clear() { _appTileQueue.Clear(); _appTileQueueHeight = 0; _flowLayout.Controls.Clear(); _flowLayout.Height = 0; _tileDictionary.Clear(); _lastTileLight = false; }
0
38. Example
View licensepublic 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(); } } }
0
39. Example
View licenseprivate 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(); }
0
40. Example
View licenseprivate void initSideDrawer() { bool LastControlWasDivider = false; /n ..... /n //View Source file for more details /n }
0
41. Example
View licensepublic 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(); }
0
42. Example
View licenseprotected 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); }
0
43. Example
View licenseprivate 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(); }
0
44. Example
View licenseprivate 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; }
0
45. Example
View licenseprivate void RegisterAreaRenderHelper(TerraformingOptions terraformingOptions = null, PersistedSimul/n ..... /n //View Source file for more details /n }
0
46. Example
View licenseprivate 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()); }
0
47. Example
View licensepublic 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; }
0
48. Example
View licensepublic void ClearControlTree() { if (_intermediateContainer != null) _intermediateContainer.Controls.Clear(); if (_next != null) _next.ClearControlTree(); if (!this.IsLeaf) _childList.ClearControlTree(); }
0
49. Example
View licenseprivate 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(); }
0
50. Example
View licenseprivate 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(); }