40 references to Contains
System.Windows.Forms (13)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
1870if (_control == target || _control.Contains(target))
System\Windows\Forms\Control.cs (2)
5473if (!Contains(ctl)) 9852if (!Contains(ctl) || (!nested && ctl._parent != this))
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
1058if (dataGridView.GetContainerControl() is ContainerControl cc && (dataGridView.EditingControl == cc.ActiveControl || dataGridView.EditingControl.Contains(cc.ActiveControl)))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.MouseHook.cs (1)
166&& !_control.Contains(targetControl))
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (1)
377if (containingControl is not null && containingControl.Contains(site))
System\Windows\Forms\Layout\Containers\ContainerControl.cs (5)
470if (control == _activeControl || control.Contains(_activeControl)) 519&& (cc._unvalidatedControl == control || control.Contains(cc._unvalidatedControl))) 525if (control == _unvalidatedControl || control.Contains(_unvalidatedControl)) 630&& !Contains(_activeControl), "ActiveControl is not a child of this ContainerControl"); 1463if (value is not null && !Contains(value))
System\Windows\Forms\Layout\Containers\SplitContainer.cs (2)
1828if (!Contains(ctl) || 1931if (!Contains(ctl) ||
System.Windows.Forms.Design (13)
System\Windows\Forms\Design\CommandSet.cs (5)
1527else if (selectedControl.Parent != commonParent && !commonParent.Contains(selectedControl)) 1530commonParent = selectedControl == commonParent || selectedControl.Contains(commonParent) ? selectedControl.Parent : null; 1673if (selectedControl.Parent != controlCommonParent && !controlCommonParent.Contains(selectedControl)) 1676if (selectedControl == controlCommonParent || selectedControl.Contains(controlCommonParent)) 1684while (parent is not null && !parent.Contains(selectedControl))
System\Windows\Forms\Design\ControlCommandSet.cs (3)
1454if (targetSelection is null && ctl is not null && (baseCtl.Contains(ctl) || baseCtl == currentSelection)) 1748else if (cX.Parent is null || cX.Contains(cY)) 1752else if (cY.Parent is null || cY.Contains(cX))
System\Windows\Forms\Design\ControlDesigner.cs (1)
408=> parentDesigner is ParentControlDesigner p && !Control.Contains(p.Control);
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
455if (host is not null && newChild is not null && !Control.Contains(newChild) 783return !control.Contains(Control);
System\Windows\Forms\Design\TabControlDesigner.cs (1)
112public override bool CanParent(Control control) => (control is TabPage && !Control.Contains(control));
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (1)
1981if (targetSelection is null && ctl is not null && (baseCtl.Contains(ctl) || baseCtl == currentSelection))
System.Windows.Forms.Tests (14)
System\Windows\Forms\ControlTests.Methods.cs (14)
803Assert.True(parent.Contains(control)); 804Assert.True(parent.Contains(child1)); 805Assert.True(parent.Contains(child2)); 806Assert.True(parent.Contains(grandchild1)); 807Assert.False(parent.Contains(parent)); 809Assert.True(control.Contains(child1)); 810Assert.True(control.Contains(child2)); 811Assert.True(control.Contains(grandchild1)); 812Assert.False(control.Contains(control)); 813Assert.False(control.Contains(parent)); 815Assert.False(control.Contains(emptyControl)); 816Assert.False(control.Contains(otherParent)); 817Assert.False(control.Contains(otherControl)); 818Assert.False(control.Contains(null));