public void removeFrom(Control.ControlCollection controls) { controls.Remove(depthTextBox); controls.Remove(statusLabel); controls.Remove(amountTextBox); controls.Remove(deleteCheckBox); }
private void RemoveView(int uid) { foreach (Object view in ViewList) { if (view is ViewBox) { ViewBox viewType = (ViewBox)view; if (viewType.Uid == uid) { ViewList.Remove(viewType); break; } } else if (view is ViewCupboard) { ViewCupboard viewType = (ViewCupboard)view; if (viewType.Uid == uid) { ViewList.Remove(viewType); break; } } } }
public void InitializeMarkerControls(IList <double> xValues, IList <double> yValues) { DataCount = xValues.Count; while (Markers.Count < DataCount) { MarkerControl markerControl = new MarkerControl(); markerControl.Paint += PaintMarker; markerControl.MouseEnter += ShowMarkerValue; markerControl.MouseLeave += HideMarkerValue; _container.Add(markerControl); Markers.Add(markerControl); } int removeIndex = Markers.Count - 1; while (Markers.Count > DataCount) { MarkerControl removedMarker = Markers[removeIndex]; _container.Remove(removedMarker); removedMarker.Dispose(); Markers.RemoveAt(removeIndex); } for (int i = 0; i < DataCount; i++) { if (Markers[i].Height != MarkerSize) { Markers[i].Width = MarkerSize; Markers[i].Height = MarkerSize; } Markers[i].XValue = xValues[i]; Markers[i].YValue = yValues[i]; } }
public void goUp(Map map, Control.ControlCollection Controls) { int[] heroPosition = map.findHeroPosition(); Part help; Part help2; Part toRemove; if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(Wall)) //gdy na prawo bedzie sciana { return; } if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(Floor)) //gdy na prawo bedzie podloga { help = map.getPart(heroPosition[0] - 1, heroPosition[1]); map.setPart(map.getPart(heroPosition[0], heroPosition[1]), heroPosition[0] - 1, heroPosition[1]); map.setPart(help, heroPosition[0], heroPosition[1]); map.getPart(heroPosition[0] - 1, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 1, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 1, heroPosition[1]).getY() - 64); map.getPart(heroPosition[0], heroPosition[1]).setPosition(map.getPart(heroPosition[0], heroPosition[1]).getX(), map.getPart(heroPosition[0], heroPosition[1]).getY() + 64); incrementNumberSteps(); } if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(Box)) //gdy na prawo bedzie skrzynka { if (map.getPart(heroPosition[0] - 2, heroPosition[1]).GetType() == typeof(Floor) || map.getPart(heroPosition[0] - 2, heroPosition[1]).GetType() == typeof(BoxPoint)) //sprawdz czy mozna przesunac skrzynke(podloga lub punkt) { help = map.getPart(heroPosition[0], heroPosition[1]); map.setPart(Factory.produceFloor(heroPosition[1] * 64, heroPosition[0] * 64, map.getStyle()), heroPosition[0], heroPosition[1]); Controls.Add(map.getPart(heroPosition[0], heroPosition[1]).picturebox); help2 = map.getPart(heroPosition[0] - 1, heroPosition[1]);// = 5; map.setPart(help, heroPosition[0] - 1, heroPosition[1]); toRemove = map.getPart(heroPosition[0] - 2, heroPosition[1]); map.setPart(help2, heroPosition[0] - 2, heroPosition[1]); map.getPart(heroPosition[0] - 1, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 1, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 1, heroPosition[1]).getY() - 64); map.getPart(heroPosition[0] - 2, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 2, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 2, heroPosition[1]).getY() - 64); Controls.Remove(toRemove.picturebox); incrementNumberSteps(); } else { } } if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(BoxPoint)) //gdy na prawo bedzie punkt { help = map.getPart(heroPosition[0], heroPosition[1]); map.setPart(Factory.produceFloor(heroPosition[1] * 64, heroPosition[0] * 64, map.getStyle()), heroPosition[0], heroPosition[1]); Controls.Add(map.getPart(heroPosition[0], heroPosition[1]).picturebox); toRemove = map.getPart(heroPosition[0] - 1, heroPosition[1]); map.setPart(help, heroPosition[0] - 1, heroPosition[1]); map.getPart(heroPosition[0] - 1, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 1, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 1, heroPosition[1]).getY() - 64); Controls.Remove(toRemove.picturebox); incrementNumberSteps(); } addBoxPoints(map, Controls); }
public void MakeBoom(Control x, Control.ControlCollection Controls, Point point, Game game) { var timer = new Timer() { Interval = 500 }; x.Size = new Size(300, 300); var location = new Point(point.X - x.Size.Width / 2, point.Y - x.Size.Height / 2); boom.Location = location; Controls.Add(boom); Controls.Remove(x); x.Tag = "bombPB"; Sound.bomb.Play(); for (var i = 0; i < Controls.Count; i++) { if ((string)Controls[i].Tag == "enemies" && boom.Bounds.IntersectsWith(Controls[i].Bounds)) { Controls.Remove(Controls[i]); game.Score += 1; i -= 1; game.TotalSum += 1; game.Shooting = false; } } timer.Start(); timer.Tick += (sender, e) => { Controls.Remove(boom); timer.Stop(); }; }
public static bool Collision(PictureBox ball, Control c, Control.ControlCollection control) { if (ball.Bounds.IntersectsWith(c.Bounds)) { control.Remove(ball); control.Remove(c); return(false); } return(true); }
public void RemovePrevious(Dictionary <TextBox, ListBox> lists, Control.ControlCollection Controls) { if (lists != null) { foreach (var remove in lists) { Controls.Remove(remove.Key); Controls.Remove(remove.Value); } } }
private void buttonImport_Click(object sender, EventArgs e) { var form = new ImportMode(modFilter, playerItemDao, sm) { TopLevel = false }; parentContainer.Add(form); parentContainer.Remove(this); form.Show(); this.Close(); }
private void Click_RemoveToBlendPanel(object ss, EventArgs ee, Control.ControlCollection cc2, PictureBox pbx, int index) {//when you click a picture in the left panel it gets rem,oved from the panel and from the list box in the left bottom part cc2.Remove(pbx); updateItem(index, 0, itemList[index].quantity + 1, itemList[index].soldCount - 1, ite); rtbxDetails.Text = "Name: " + itemList[index].name + "\nQuantity: " + itemList[index].quantity + "\nCost: $" + itemList[index].cost; displayRecipt(); }
public static IEnumerable <TControl> RenderControlList <TModel, TKey, TControl>(this IEnumerable <TModel> models, Control.ControlCollection controls, Func <TModel, int, TKey> key, Func <TModel, int, TControl> builder) where TControl : Control { var existingKeys = controls.OfType <Control>().Where(x => x.Tag is ControlKey).ToDictionary(x => ((ControlKey)x.Tag).Key); var index = 0; var result = new List <TControl>(); foreach (var m in models) { var k = key(m, index); if (existingKeys.TryGetValue(k, out Control c)) { // not build again existingKeys.Remove(k); } else { c = builder(m, index); c.Tag = new ControlKey(k); controls.Add(c); } controls.SetChildIndex(c, index); index++; result.Add((TControl)c); } // remove unused controls foreach (var value in existingKeys.Values) { controls.Remove(value); } return(result); }
protected void ShowInvalidState() { this.SuspendLayout(); Control.ControlCollection ctls = this.Controls; for (int i = ctls.Count - 1; i >= 0; i--) { Control ctl = ctls[i]; if (!object.ReferenceEquals(ctl, this.btnCancel) && !object.ReferenceEquals(ctl, this.pnlTitle) && !object.ReferenceEquals(ctl, this.lineAction)) { ctls.Remove(ctl); ctl.Dispose(); } } Label lblMsg = new Label(); lblMsg.Name = "lblMsg"; lblMsg.Text = "Invalid object state!"; lblMsg.UseMnemonic = false; lblMsg.BorderStyle = BorderStyle.None; lblMsg.Location = new Point(12, this.lblTitle.Height + 12); lblMsg.Size = new Size(this.ClientSize.Width - 24, this.ClientSize.Height - this.btnCancel.Height - this.lblTitle.Height - 30); lblMsg.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right; if (this.mEntity != null) { this.Text = this.mEntity.GetType().Name; } this.btnCancel.Text = "&Close"; this.Controls.Add(lblMsg); this.ResumeLayout(false); }
public static void Remove(Control.ControlCollection coll, Control item) { if ((coll != null) && (item != null)) { Button tempButton = null; Form parentForm = item.FindForm(); if (parentForm != null) { // Create a hidden, temporary button tempButton = new Button(); tempButton.Visible = false; // Add this temporary button to the parent form parentForm.Controls.Add(tempButton); // Must ensure that temp button is the active one parentForm.ActiveControl = tempButton; } // Remove our target control coll.Remove(item); if (parentForm != null) { // Remove the temporary button tempButton.Dispose(); parentForm.Controls.Remove(tempButton); } } }
public void ClearRedGhost() { lock (this) { c.Remove(redGhost); } }
public UserControl UcSetting = new UserControl(); // holds current settings user control private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button != MouseButtons.Left) { return; } var tmp = new UserControl(); switch (e.Node.Name) { case "General": // General tmp = new General(); break; case "AutoPos": // Auto postion tmp = new AutoPosition(); break; case "PingCheck": case "ConnectionCheck": tmp = new SettingsTree.ConnectionCheck(); break; case "IpHostCheck": tmp = new IpHostCheck(); break; case "AntiIdle": tmp = new AntiIdle(); break; case "ProfileKickstart": tmp = new ProfileKickstart(); break; case "HotKeys": tmp = new HotKeys(); break; case "Stats": tmp = new Stats(); break; } // Check if new user control should be displayed if (!tmp.Name.Equals(UcSetting.Name)) { //var c = tabControl1.TabPages[1].Controls; Control.ControlCollection c = SettingsPanel.Controls; if (c.Contains(UcSetting)) { c.Remove(UcSetting); } UcSetting = tmp; //_ucSetting.Left = 180; c.Add(UcSetting); } }
public static void Remove(this Control.ControlCollection c, params Control[] controls) { foreach (Control thing in controls) { c.Remove(thing); } }
protected override void AddFilterPanel(string text, object viewSiteControl) { Control.ControlCollection controlCollection = ((Control)viewSiteControl).Controls; if (string.IsNullOrEmpty(text)) { FilterPanel filterPanel = controlCollection.OfType <FilterPanel>().FirstOrDefault(); if (filterPanel != null) { controlCollection.Remove(filterPanel); } } else { var filterPanel = new FilterPanel { BackColor = Color.LightGoldenrodYellow, Dock = DockStyle.Bottom, MaxRows = 25, TabIndex = 0, TabStop = false, MinimumSize = new Size(350, 33), Text = text }; Control.ControlCollection collection = controlCollection; collection.Add(filterPanel); } }
public void CleanTable <TGroupsLabels>(Control.ControlCollection Controls, TGroupsLabels labels) where TGroupsLabels : IEnumerable <Control> { foreach (var groupLabel in labels) { Controls.Remove(groupLabel); } }
private static void RemoveCardButtons(Control.ControlCollection controls) { foreach (var control in controls.Find(CardButtonName, true)) { controls.Remove(control); } }
private void DoHideProgress() { ProgressFrame ef = FindFrame(); if (ef != null) { Collection.Remove(ef); ef.Dispose(); } foreach (Control ctrl in Collection) { if (ctrl is ToolStrip) { continue; } bool?vis = null; if (m_forceVisibility != null) { vis = m_forceVisibility(ctrl); } ctrl.Visible = vis ?? true; } ProgressVisible = false; }
/// <summary> /// Remove specified child item from the provided control collection. /// </summary> /// <param name="coll">Control collection that child item needs to be removed from.</param> /// <param name="item">Child control to remove from collection.</param> public static void Remove(Control.ControlCollection coll, Control item) { if ((coll != null) && (item != null)) { // Remove our target control coll.Remove(item); } }
public void RemoveAll(PictureBox[] enemies, Control.ControlCollection Controls) { foreach (var i in enemies) { Controls.Remove(i); } foreach (Control x in Controls) { if ((string)x.Tag == "peas" || (string)x.Tag == "enemyPeas" || (string)x.Tag == "peasLeft" || (string)x.Tag == "peasCenter" || (string)x.Tag == "peasRight" || (string)x.Tag == "peasCenter" || (string)x.Tag == "explosion" || (string)x.Tag == "bonusTriple" || (string)x.Tag == "bonusBomb" || (string)x.Tag == "3") { Controls.Remove(x); } } }
static public void MeDelete(Control.ControlCollection cons, WizItemSelect cmb) { if (cons.Count <= 0) { return; } cons.Remove(cmb); cmb.Dispose(); }
static public void ClearContainer(Control.ControlCollection controls) { while (controls.Count > 0) { Control c = controls[0]; controls.Remove(c); c.Dispose(); } }
public static void DeletePictureBox(Control.ControlCollection controlCol, string type) { foreach (Control control in controlCol) { if (control.Name.Contains("createPicBox_" + type)) { controlCol.Remove(control); } } }
private void RemoveControlFrom(Control.ControlCollection controls, string controlname) { foreach (Control control in controls) { if (control.Name.ToLower() == controlname.ToLower()) { controls.Remove(control); controls.Owner.Update(); } } }
private void RemoveView(int uid) { foreach (Kitbox.GUI.ViewCupboard view in ViewCupboardList) { if (view.Uid == uid) { ViewCupboardList.Remove(view); break; } } }
void RemoveControlTaoGuan(Control.ControlCollection list) { //套管减少的函数 foreach (Control ctrl in list) { if (ctrl is Label) { if (string.Equals(ctrl.Text, "套管" + TaoGuan)) { list.Remove(ctrl); TaoGuan--; break; } } } foreach (Control ctrl in list) { if (ctrl is HZH_Controls.Controls.UCTextBoxEx) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + FirstTextBoxTaoGuan)) { list.Remove(ctrl); FirstTextBoxTaoGuan = FirstTextBoxTaoGuan - 5;; break; } } } foreach (Control ctrl in list) { if (ctrl is HZH_Controls.Controls.UCTextBoxEx) { if (string.Equals(ctrl.Name, "ucTextBoxEx" + SecondTextBoxTaoGuan)) { list.Remove(ctrl); SecondTextBoxTaoGuan = SecondTextBoxTaoGuan - 5; break; } } } }
/// <summary> /// 퍼즐 조각을 삭제 합니다. /// </summary> /// <param name="controls">삭제할 컨트롤의 모임</param> public void RemovePiece(Control.ControlCollection controls) { int n = 0; for (int i = 0; i < pieceNum; i++) { for (int j = 0; j < pieceNum; j++) { n++; controls.Remove(this.piece[i, j]); } } }
public void MoveTriple(Control.ControlCollection Controls, Game game) { foreach (Control x in Controls) { if ((string)x.Tag == "peasLeft") { x.Top -= 20; x.Left += 10; //5 if (x.Top < 15) { Controls.Remove(x); game.Shooting = false; } } if ((string)x.Tag == "peasCenter") { x.Top -= 20; if (x.Top < 15) { Controls.Remove(x); game.Shooting = false; } } if ((string)x.Tag == "peasRight") { x.Top -= 20; x.Left -= 10; //5 if (x.Top < 15) { Controls.Remove(x); game.Shooting = false; } } } }
//metoda do uzupelnienia brakujacych BoxPointow public void addBoxPoints(Map map, Control.ControlCollection Controls) { foreach (Point p in map.getPointList()) { if (map.getPart(p.X, p.Y).GetType() == typeof(Floor)) { int x = map.getPart(p.X, p.Y).getX(); int y = map.getPart(p.X, p.Y).getY(); Part toRemove = map.getPart(p.X, p.Y); map.setPart(Factory.produceBoxPoint(x, y, map.getStyle()), p.X, p.Y); Controls.Add(map.getPart(p.X, p.Y).picturebox); Controls.Remove(toRemove.picturebox); } } }