51 types derived from Control
PresentationUI (1)
MS\Internal\Documents\DialogDivider.cs (1)
15internal class DialogDivider : System.Windows.Forms.Control
System.Windows.Forms (33)
System\Windows\Forms\ActiveX\AxHost.cs (1)
27public abstract unsafe partial class AxHost : Control, ISupportInitialize, ICustomTypeDescriptor
System\Windows\Forms\Application.MarshallingControl.cs (1)
14private sealed class ContextMarshallingControl : Control
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
18public abstract partial class ButtonBase : Control, ICommandBindingTargetProvider
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
17public partial class DataGridView : Control, ISupportInitialize
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
23public partial class DateTimePicker : Control
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
19public partial class GroupBox : Control
System\Windows\Forms\Controls\Labels\Label.cs (1)
27public partial class Label : Control, IAutomationLiveRegion
System\Windows\Forms\Controls\ListControl\ListControl.cs (1)
12public abstract class ListControl : Control
System\Windows\Forms\Controls\ListView\ListView.cs (1)
31public partial class ListView : Control
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
60public partial class MonthCalendar : Control
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
22public partial class PictureBox : Control, ISupportInitialize
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
17public partial class ProgressBar : Control
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.SnappableControl.cs (1)
10internal abstract class SnappableControl : Control
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridToolTip.cs (1)
6internal class GridToolTip : Control
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
19Control,
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
20public partial class Splitter : Control
System\Windows\Forms\Controls\TabControl\TabControl.cs (1)
22public partial class TabControl : Control
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
24public abstract partial class TextBoxBase : Control
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
613private class RightToLeftLayoutGrip : Control
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
24public partial class TrackBar : Control, ISupportInitialize
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
27public partial class TreeView : Control
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGrid.cs (1)
29public partial class DataGrid : Control, ISupportInitialize, IDataGridEditingService
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBar.cs (1)
26public partial class StatusBar : Control
System\Windows\Forms\Controls\Unsupported\ToolBar\ToolBar.cs (1)
27public partial class ToolBar : Control
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (1)
19internal partial class UpDownButtons : Control
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
32public unsafe partial class WebBrowserBase : Control
System\Windows\Forms\MDI\MDIClient.cs (1)
21public sealed partial class MdiClient : Control
System\Windows\Forms\Printing\PrintPreviewControl.cs (1)
18public partial class PrintPreviewControl : Control
System\Windows\Forms\Printing\PrintPreviewControl.HorizontalScrollBar.cs (1)
6public partial class PrintPreviewControl : Control
System\Windows\Forms\Printing\PrintPreviewControl.VerticalScrollBar.cs (1)
6public partial class PrintPreviewControl : Control
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
14public partial class ScrollableControl : Control, IArrangedElement
System\Windows\Forms\Scrolling\ScrollBar.cs (1)
16public abstract partial class ScrollBar : Control
System\Windows\Forms\SendKeys\SendKeys.SKWindow.cs (1)
11private class SKWindow : Control
System.Windows.Forms.Design (15)
System\ComponentModel\Design\DateTimeEditor.DateTimeUI.cs (1)
14private class DateTimeUI : Control
System\Drawing\Design\ColorEditor.ColorPalette.cs (1)
13private partial class ColorPalette : Control
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
15private sealed partial class ColorUI : Control
System\Drawing\Design\SelectionPanelBase.cs (1)
9internal abstract partial class SelectionPanelBase : Control
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (4)
13private class AnchorUI : Control 180private class ContainerPlaceholder : Control 196private class ControlPlaceholder : Control 212private class SpringControl : Control
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (1)
14private partial class AdornerWindow : Control
System\Windows\Forms\Design\ComponentTray.cs (1)
1880internal class TrayControl : Control
System\Windows\Forms\Design\DesignerFrame.cs (1)
25internal class DesignerFrame : Control, IOverlayService, ISplitWindowService, IContainsThemedScrollbarWindows
System\Windows\Forms\Design\DockEditor.DockUI.cs (1)
291private class ContainerPlaceholder : Control
System\Windows\Forms\Design\SelectionUIService.cs (1)
23internal sealed partial class SelectionUIService : Control, ISelectionUIService
System\Windows\Forms\Design\TabOrder.cs (1)
18internal class TabOrder : Control, IMouseHandler, IMenuStatusHandler
System\Windows\Forms\Design\ToolStripAdornerWindowService.cs (1)
158private class ToolStripAdornerWindow : Control
WindowsFormsIntegration (2)
System\Windows\Integration\ElementHost.cs (1)
42public class ElementHost : Control
System\Windows\Integration\WindowsFormsHost.cs (1)
786private class FocusTargetControl : Control
3 instantiations of Control
System.Windows.Forms.Design (3)
System\ComponentModel\Design\DesignerActionUI.cs (1)
105_marshalingControl = new Control();
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
183private Control DropSource => _dropSource ??= new Control();
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
41_dropSource ??= new Control();
1792 references to Control
Microsoft.AspNetCore.Components.WebView.WindowsForms (9)
BlazorWebView.cs (7)
61 /// <inheritdoc cref="Control.OnCreateControl" /> 268 /// <inheritdoc cref="Control.Dispose(bool)" /> 289 /// <inheritdoc cref="Control.CreateControlsInstance" /> 326 internal void AddInternal(Control value) => base.Add(value); 331 public override void Add(Control? value) => throw new NotSupportedException(); 333 public override void Remove(Control? value) => throw new NotSupportedException(); 334 public override void SetChildIndex(Control child, int newIndex) => throw new NotSupportedException();
WindowsFormsDispatcher.cs (2)
20 private readonly Control _dispatchThreadControl; 28 public WindowsFormsDispatcher(Control dispatchThreadControl)
Microsoft.VisualBasic.Forms (3)
Microsoft\VisualBasic\Devices\Keyboard.vb (3)
21Dim keys As Keys = Control.ModifierKeys 46Dim keys As Keys = Control.ModifierKeys 85Dim keys As Keys = Control.ModifierKeys
PresentationUI (7)
MS\Internal\Documents\Application\DocumentPropertiesDialog.cs (2)
139private void SetTextProperty(Control control, string text) 153private void SetTextProperty(Control control, DateTime? date)
MS\Internal\Documents\DialogBaseForm.cs (3)
93private void ApplyDialogFont(Control control) 96foreach (Control c in control.Controls) 134private void ApplyDialogFontToPropertyGrid(Control control)
MS\Internal\Documents\PeoplePickerWrapper.cs (2)
269System.Windows.Forms.Control rmPublishingDialog = 270System.Windows.Forms.Control.FromHandle(hWndParent) as RMPublishingDialog;
System.Windows.Forms (1021)
src\winforms\src\Common\src\Obsoletions.cs (1)
17internal const string DomainUpDownAccessibleObjectMessage = $"DomainUpDownAccessibleObject is no longer used to provide accessible support for {nameof(DomainUpDown)} controls. Use {nameof(Control.ControlAccessibleObject)} instead.";
System\Windows\Forms\Accessibility\AccessibleObject.cs (3)
274/// Note that the default behavior for <see cref="Control"/> is that it calls base from its override in 275/// <see cref="Control.ControlAccessibleObject"/>. <see cref="Control.ControlAccessibleObject"/> always
System\Windows\Forms\Accessibility\AccessibleObject.EnumVariantObject.cs (1)
155/// <see cref="Control.Controls"/> collection).
System\Windows\Forms\Accessibility\AccessibleObjectExtensions.cs (3)
307where TAccessible : AccessibleObject, IOwnedObject<Control> 319string? defaultName = null) where TAccessible : AccessibleObject, IOwnedObject<Control> 326where TAccessible : AccessibleObject, IOwnedObject<Control>
System\Windows\Forms\Accessibility\AccessibleRoles.cs (1)
10/// If adding to this enumeration please update <see cref="Control.AccessibleRole"/> and
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (26)
17public class ControlAccessibleObject : AccessibleObject, IOwnedObject<Control> 29private readonly WeakReference<Control> _ownerControl; 31public ControlAccessibleObject(Control ownerControl) 36internal ControlAccessibleObject(Control ownerControl, int accObjId) 57=> this.TryGetOwnerAs(out Control? owner) ? owner.Name : string.Empty; 64if (!this.TryGetOwnerAs(out Control? owner) || owner.ToolStripControlHost is not ToolStripControlHost host) 84=> this.TryGetOwnerAs(out Control? owner) && owner.GetStyle(ControlStyles.ContainerControl) 121if (!this.TryGetOwnerAs(out Control? owner)) 130Control? parentControl = owner.ParentInternal; 134Control[]? ctrls = null; 231/// the <see cref="Control.Handle"/> property of the <see cref="Owner"/> it is associated with. 274if (this.TryGetOwnerAs(out Control? owner) 288&& (!this.TryGetOwnerAs(out Control? owner) 311if (this.TryGetOwnerAs(out Control? owner) && owner.AccessibleName is { } name) 324if (this.TryGetOwnerAs(out Control? owner)) 348if (this.TryGetOwnerAs(out Control? owner) && owner.GetStyle(ControlStyles.UseTextForAccessibility)) 381public Control? Owner => _ownerControl.TryGetTarget(out Control? owner) ? owner : null; 393if (!this.TryGetOwnerAs(out Control? owner) || owner.ParentInternal is not { } parent) 405for (Control? previous = container.GetNextControl(owner, false); 437if (!this.TryGetOwnerAs(out Control? owner) 454&& (!this.TryGetOwnerAs(out Control? owner) 490if (this.TryGetOwnerAs(out Control? owner)) 501=> (this.TryGetOwnerAs(out Control? owner) && owner.SupportsUiaProviders && patternId == UIA_PATTERN_ID.UIA_LegacyIAccessiblePatternId) 529=> this.IsOwnerHandleCreated(out Control? _) && base.RaiseAutomationEvent(eventId); 532=> this.IsOwnerHandleCreated(out Control? _)
System\Windows\Forms\Accessibility\LabelEditAccessibleObject.cs (1)
16public LabelEditAccessibleObject(Control owningControl, LabelEditNativeWindow labelEdit)
System\Windows\Forms\Accessibility\LabelEditNativeWindow.cs (3)
13private readonly WeakReference<Control> _owningControl; 28public LabelEditNativeWindow(Control owningControl) 85if (_owningControl.TryGetTarget(out Control? target) && !target.IsAccessibilityObjectCreated)
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (4)
27private readonly WeakReference<Control> _owningControl; 29public LabelEditUiaTextProvider(Control owner, LabelEditNativeWindow childEdit, AccessibleObject childEditAccessibilityObject) 60public override LOGFONTW Logfont => _owningControl.TryGetTarget(out Control? target) ? target.Font.ToLogicalFont() : default; 179if (IsDegenerate(_owningControl.TryGetTarget(out Control? target) ? target.ClientRectangle : Rectangle.Empty))
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (15)
33private HashSet<Control>? _components; 34private Dictionary<Control, ExtenderProxy>? _extenderCache; 82internal ExtenderProxy? GetExtenderProxyForControl(Control control) 119internal static string GetNameForControl(Control control) 158internal IEnumUnknown.Interface EnumControls(Control control, uint dwOleContF, ENUM_CONTROLS_WHICH_FLAGS dwWhich) 163Control? additionalControl; 196Control[] controls = []; 286private void MaybeAdd(List<object> controls, Control control, bool selected, OLECONTF flags, bool allowContainingControls) 324if (component is Control control && component != _parent && component.Site is not null) 354void GetAllChildren(Control control) 363foreach (Control child in control.Controls) 370private HashSet<Control> GetComponents() 425internal static AxContainer? FindContainerForControl(Control control) 535foreach (Control control in GetComponents()) 586foreach (Control control in GetComponents())
System\Windows\Forms\ActiveX\AxHost.AxContainer.ExtenderProxy.cs (5)
15/// Provides an <see cref="IDispatch"/> and <see cref="IDispatchEx"/> view of <see cref="Control"/> 26private readonly WeakReference<Control> _control; 30internal ExtenderProxy(Control control, AxContainer container) 39private Control? GetControl() 41_control.TryGetTarget(out Control? target);
System\Windows\Forms\ActiveX\AxHost.cs (9)
1597Control? control = container?.ActiveControl; 1934/// The <see cref="ContainingControl"/> property value can be different from the <see cref="Control.Parent"/> 1938/// property value of the ActiveX control is the <see cref="Form"/>, and the <see cref="Control.Parent"/> 1992Control? control = this; 2075Control? richParent = ParentInternal; 2119Control? control = this; 2146Control? parent = ParentInternal; 3002public unsafe void ShowPropertyPages(Control? control) 3323Control? parent = ParentInternal;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (8)
124private readonly Control _control; 151internal ActiveXImpl(Control control) 354Control target = _control; 367Control? realTarget = target.GetChildAtPoint(pt); 710private static void GetMnemonicList(Control control, List<char> mnemonicList) 720foreach (Control c in control.Controls) 1221private static void CallParentPropertyChanged(Control control, string propName) 1861Control? target = FromChildHandle(lpmsg->hwnd);
System\Windows\Forms\Application.cs (2)
952/// Enables visual styles for all subsequent <see cref="Run()"/> and <see cref="Control.CreateHandle"/> calls. 1378Control.UseCompatibleTextRenderingDefault = defaultValue;
System\Windows\Forms\Application.MarshallingControl.cs (1)
12/// on the correct thread via <see cref="Control.Invoke(Action)"/>.
System\Windows\Forms\Application.ModalApplicationContext.cs (2)
22Control? parentControl = null; 32parentControl = Control.FromHandle(parentHandle);
System\Windows\Forms\Application.ThreadContext.cs (9)
42private Control? _marshallingControl; 52private WeakReference<Control>? _activatingControlRef; 161internal Control? ActivatingControl 163get => _activatingControlRef?.TryGetTarget(out Control? target) ?? false ? target : null; 170internal Control MarshallingControl 936Control? target = Control.FromChildHandle(msg.hwnd); 946if (Control.PreProcessControlMessageInternal(target, ref m) == PreProcessControlState.MessageProcessed) 955if (Control.PreProcessControlMessageInternal(target, ref m) == PreProcessControlState.MessageProcessed)
System\Windows\Forms\Application.ThreadWindows.cs (3)
35if (!_onlyWinForms || Control.FromHandle(hwnd) is not null) 51Control.FromHandle(hwnd)?.Dispose(); 62Control? activatingControl = ThreadContext.FromCurrent().ActivatingControl;
System\Windows\Forms\BoundsSpecified.cs (4)
40/// Both <see cref="Control.Width"/> and <see cref="Control.Height"/> 46/// Both <see cref="Control.Location"/> and <see cref="Control.Size"/>
System\Windows\Forms\ComponentModel\COM2Interop\COM2FontConverter.cs (3)
36_lastFont = Control.DefaultFont; 59_lastFont = Control.DefaultFont; 67managedValue ??= Control.DefaultFont;
System\Windows\Forms\ContextMenuStrip.cs (2)
37public Control? SourceControl 82internal void ShowInternal(Control source, Point location, bool isKeyboardActivated)
System\Windows\Forms\Control.ControlCollection.cs (21)
24public ControlCollection(Control owner) 42public virtual void Add(Control? value) 96Control? oldParent = value._parent; 127if (control is Control c) 139public virtual void AddRange(params Control[] controls) 166public bool Contains(Control? control) => ((IList)InnerList).Contains(control); 172public Control[] Find(string key, bool searchAllChildren) 176List<Control> foundControls = []; 185private static void FindInternal(string key, bool searchAllChildren, ControlCollection controlsToLookIn, List<Control> foundControls) 232public int IndexOf(Control? control) => ((IList)InnerList).IndexOf(control); 280public Control Owner { get; } 286public virtual void Remove(Control? value) 314if (control is Control c) 340public new virtual Control this[int index] 348Control control = (Control)InnerList[index]!; 357public virtual Control? this[string? key] 397public int GetChildIndex(Control child) => GetChildIndex(child, true); 403public virtual int GetChildIndex(Control child, bool throwException) 418internal virtual void SetChildIndexInternal(Control child, int newIndex) 445public virtual void SetChildIndex(Control child, int newIndex) =>
System\Windows\Forms\Control.ControlNativeWindow.cs (3)
12private readonly Control _control; 15internal ControlNativeWindow(Control control) 21internal Control GetControl()
System\Windows\Forms\Control.ControlTabOrderHolder.cs (1)
12private readonly record struct ControlTabOrderHolder(int OriginalIndex, int TabIndex, Control? Control)
System\Windows\Forms\Control.ControlVersionInfo.cs (2)
16private readonly Control _owner; 18internal ControlVersionInfo(Control owner)
System\Windows\Forms\Control.cs (126)
249private Control? _parent; 250private WeakReference<Control>? _reflectParent; 302/// Initializes a new instance of the <see cref="Control"/> class. 396/// Initializes a new instance of the <see cref="Control"/> class. 403/// Initializes a new instance of the <see cref="Control"/> class. 411/// Initializes a new instance of the <see cref="Control"/> class. 413public Control(Control? parent, string? text) : this() 420/// Initializes a new instance of the <see cref="Control"/> class. 422public Control(Control? parent, string? text, int left, int top, int width, int height) : this(parent, text) 496/// of Control inheritance in WinForms. The constructor of <see cref="Control"/> calls <see cref="CreateParams"/>, 503/// and related logic may be triggered during the base <see cref="Control"/> construction process, before the 876Control? parent = ParentInternal; 1044Control? parent = ParentInternal; 1485if (container.ParentInternal is not Control parent 1708Control? control = ParentInternal; 2254Control topMost = TopMostParent; 2320Control? parent = ParentInternal; 2382Control control; 2389Control marshalingControl = FindMarshalingControl(); 2433private static ISite? GetSitedParentSite(Control control) 2701public Control? Parent 2707internal virtual Control? ParentInternal 2779private Control? ReflectParent 2781get => _reflectParent?.TryGetTarget(out Control? parent) ?? false ? parent : null; 2786Control? existing = ReflectParent; 3232for (Control? control = this; control is not null; control = control.ParentInternal) 3276public Control? TopLevelControl => TopLevelControlInternal; 3278internal Control? TopLevelControlInternal 3282Control? control = this; 3292internal Control TopMostParent 3296Control control = this; 4232internal virtual void AssignParent(Control? value) 4371Control marshaler = FindMarshalingControl(); 4425for (Control? ctl = this; ctl is not null; ctl = ctl._parent) 4440internal static void CheckParentingCycle(Control? bottom, Control? toFind) 4443Control? lastParent = null; 4445for (Control? ctl = bottom; ctl is not null; ctl = ctl.ParentInternal) 4478private void ChildGotFocus(Control child) 4491public bool Contains([NotNullWhen(true)] Control? ctl) 4670Control[] controlSnapshot = new Control[children.Count]; 4673foreach (Control control in controlSnapshot) 4768/// Disposes of the resources (other than memory) used by the <see cref="Control"/>. 4830Control child = children[i]; 5053Control marshaler = FindMarshalingControl(); 5099Control? current = this; 5114private Control FindMarshalingControl() 5118Control? c = this; 5122Control? p = c.ParentInternal; 5223public static Control? FromChildHandle(IntPtr handle) 5228Control? control = FromHandle(hwnd); 5242/// it with the first parent <see cref="Control"/> if possible. 5250public static Control? FromHandle(IntPtr handle) 5299public Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue) 5310Control? control = FromChildHandle(hwnd); 5323public Control? GetChildAtPoint(Point pt) => GetChildAtPoint(pt, GetChildAtPointSkip.None); 5331Control? c = IsContainerControl ? ParentInternal : this; 5341private static bool IsFocusManagingContainerControl(Control ctl) 5440Control? control = this; 5471Control? ctl = FromHandle(hWndChild); 5493internal Control[] GetChildControlsInTabOrder(bool handleCreatedOnly) 5497foreach (Control c in Controls) 5507Control[] controls = new Control[holders.Count]; 5516internal virtual Control? GetFirstChildControlInTabOrder(bool forward) 5523Control? found = null; 5599public Control? GetNextControl(Control? ctl, bool forward) 5610Control? found = ctl.GetFirstChildControlInTabOrder(forward: true); 5621Control? found = null; 5622Control? p = ctl._parent; 5684Control? found = null; 5685Control? parent = ctl._parent ?? throw new InvalidOperationException( 5705Control sibling = siblings[c]; 5765Control? found = ctl.GetFirstChildControlInTabOrder(forward: false); 5782/// Return <see cref="Handle"/> if <paramref name="window"/> is a <see cref="Control"/>. 5788if (window is Control control) 6062Control marshaler = FindMarshalingControl(); 6256protected void InvokePaint(Control c, PaintEventArgs e) 6261protected void InvokePaintBackground(Control c, PaintEventArgs e) 6272/// Returns <see langword="true"/> if <paramref name="descendant"/> is a descendant of this <see cref="Control"/>. 6274internal bool IsDescendant(Control? descendant) 6276Control? control = descendant; 6418private static bool IsScaledByParent(Control control) 6420Control? parentControl = control.Parent; 6476private object MarshaledInvoke(Control caller, Delegate method, object?[]? args, bool synchronous) 6649protected void InvokeOnClick(Control? toInvoke, EventArgs e) 6779internal virtual void OnChildLayoutResuming(Control child, bool performLayout) 7081Control? parent = ParentInternal; 7257Control child = children[i]; 7645protected void InvokeGotFocus(Control? toInvoke, EventArgs e) 7803protected void InvokeLostFocus(Control? toInvoke, EventArgs e) 8266Control? parent = ParentInternal; 8396for (Control? c = ParentInternal; c is not null; c = c.ParentInternal) 8434public void PerformLayout(Control? affectedControl, string? affectedProperty) 8550foreach (Control c in Controls) 8683/// on the <see cref="Control"/> referenced by the <paramref name="msg"/> <see cref="Message.HWnd"/>. It 8698internal static PreProcessControlState PreProcessControlMessageInternal(Control? target, ref Message message) 8845Control child = Controls[i]; 9048Control? topMostParent = null; 9247Control?[]? controlSnapshot = null; 9260controlSnapshot = new Control[children.Count]; 9264Control childControl = children[i]; 9324Control? childControl = controlSnapshot[i]; 9545Control child = children[i]; 9662internal virtual void Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl, bool causedByFontChanged = false) 9698internal void ScaleChildControls(SizeF includedFactor, SizeF excludedFactor, Control requestingControl, bool causedByFontChanged = false) 9707Control child = children[i]; 9963public bool SelectNextControl(Control? ctl, bool forward, bool tabStopOnly, bool nested, bool wrap) 9965Control? nextSelectableControl = GetNextSelectableControl(ctl, forward, tabStopOnly, nested, wrap); 9977private Control? GetNextSelectableControl(Control? ctl, bool forward, bool tabStopOnly, bool nested, bool wrap) 9985Control? start = ctl; 10036((Control)c).SelectNextControl(this, true, true, true, true); 10542internal static AutoValidate GetAutoValidateForControl(Control control) 10943private void UpdateChildControlIndex(Control control) 10950if (this is TabControl || GetType() == typeof(Control)) 10960Control? previousControl = FromHandle(hWnd); 11019private void UpdateChildZOrder(Control control) 11029Control child = Controls[i]; 11204internal void WmContextMenu(ref Message m, Control sourceControl) 11244Control? control = FromHandle(m.LParamInternal); 12858Control? controlParent = ParentInternal; 12875void AddIfCreated(Control? control) 12934internal virtual ToolInfoWrapper<Control> GetToolInfoWrapper(TOOLTIP_FLAGS flags, string? caption, ToolTip tooltip)
System\Windows\Forms\Control.ExtendedStates.cs (3)
46/// so that <see cref="PreProcessControlMessageInternal(Control, ref Message)"/> doesn't call it again. 52/// so that <see cref="PreProcessControlMessageInternal(Control, ref Message)"/> doesn't call it again. 57/// Used by <see cref="PreProcessControlMessageInternal(Control, ref Message)"/> to avoid calling
System\Windows\Forms\Control.Ime.cs (3)
46Control? parent = ParentInternal; 175Control? ctl = null; 636Control topMostWinformsParent = TopMostParent;
System\Windows\Forms\Control.SuspendLayoutScope.cs (2)
10private readonly Control? _control; 17public SuspendLayoutScope(Control? control, bool performLayout = true)
System\Windows\Forms\Control.ThreadMethodEntry.cs (4)
13internal Control _caller; 14internal Control _marshaler; 32Control caller, 33Control marshaler,
System\Windows\Forms\ControlEventArgs.cs (2)
14public ControlEventArgs(Control? control) 22public Control? Control { get; }
System\Windows\Forms\Controls\Buttons\Button.ButtonAccessibleObject.cs (2)
19=> this.TryGetOwnerAs(out Control? owner) && owner.AccessibleRole == AccessibleRole.Default 22UIA_PROPERTY_ID.UIA_HasKeyboardFocusPropertyId => (VARIANT)(this.TryGetOwnerAs(out Control? owner) && owner.Focused),
System\Windows\Forms\Controls\Buttons\Button.cs (4)
43/// Allows the control to optionally shrink when <see cref="Control.AutoSize"/> is <see langword="true"/>. 188/// Raises the <see cref="Control.OnMouseEnter"/> event. 193/// Raises the <see cref="Control.OnMouseLeave"/> event. 301/// Generates a <see cref="Control.Click"/> event for a button.
System\Windows\Forms\Controls\Buttons\ButtonBase.ButtonBaseAccessibleObject.cs (2)
10public ButtonBaseAccessibleObject(Control owner) 30internal static string? GetKeyboardShortcut(Control control, bool useMnemonic, Label? previousLabel)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (7)
181/// method will be called when the <see cref="Control.Click"/> event gets invoked. 651/// or may have flicker. Returning <see cref="Control.ClientRectangle"/> is safe for correct painting but may 689/// or may have flicker. Returning <see cref="Control.ClientRectangle"/> is safe for correct painting but may 889/// Raises the <see cref="Control.OnMouseEnter"/> event. 905/// Raises the <see cref="Control.OnMouseLeave"/> event. 919/// Raises the <see cref="Control.OnMouseMove"/> event. 950/// Raises the <see cref="Control.OnMouseDown"/> event.
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckableControlBaseAdapter.cs (1)
74internal static double GetDpiScaleRatio(Control? control) =>
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
140Control? control = null)
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\ButtonDarkModeAdapter.cs (2)
32if (Control.ForeColor != Forms.Control.DefaultForeColor) 56if (Control.BackColor != Forms.Control.DefaultBackColor)
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (2)
53public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl) 56internal static void DrawParentBackground(IDeviceContext dc, Rectangle bounds, Control childControl)
System\Windows\Forms\Controls\Buttons\CheckBox.CheckBoxAccessibleObject.cs (2)
11public class CheckBoxAccessibleObject(Control owner) : ButtonBaseAccessibleObject((owner is CheckBox) 49UIA_PROPERTY_ID.UIA_HasKeyboardFocusPropertyId => (VARIANT)(this.TryGetOwnerAs(out Control? owner) && owner.Focused),
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (2)
38/// <inheritdoc cref="ButtonRenderer.DrawParentBackground(Graphics, Rectangle, Control)"/> 39public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
System\Windows\Forms\Controls\Buttons\IButtonControl.cs (1)
24/// Generates a <see cref="Control.Click"/> event for the control.
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
504/// Generates a <see cref="Control.Click"/> event for the button, simulating a click by a user.
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (2)
39/// <inheritdoc cref="ButtonRenderer.DrawParentBackground(Graphics, Rectangle, Control)"/> 40public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (1)
2811/// Raises the <see cref="Control.Resize"/> event.
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (3)
19? VisualStyleElement.CreateElement($"{Control.DarkModeIdentifier}_{Control.ComboBoxButtonThemeIdentifier}::{Control.ComboboxClassIdentifier}", 1, 1)
System\Windows\Forms\Controls\DataGridView\DataGridView.ControlCollection.cs (4)
20public void CopyTo(Control[] array, int index) 25public void Insert(int index, Control value) 30public override void Remove(Control? value) 43internal void RemoveInternal(Control value)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (3)
268private Control? _latestEditingControl; 269private Control? _cachedEditingControl; 2229public Control? EditingControl { get; private set; }
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
1511internal override void AssignParent(Control? value) 2666EditingControl = (Control)Activator.CreateInstance(editControlType)!;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (1)
565Control.MouseButtons == MouseButtons.Left)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
355internal virtual bool IsBeingTabbedTo() => Control.AreCommonNavigationalKeysDown();
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (2)
918Control.MouseButtons == MouseButtons.Left) 989if (DataGridView.IsAccessibilityObjectCreated && DataGridView.AccessibilityObject is Control.ControlAccessibleObject accessibleObject)
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
1792bool newMouseInDropDownButtonBounds = dropDownButtonRect.Contains(DataGridView.PointToClient(Control.MousePosition));
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.DataGridViewComboBoxEditingControlAccessibleObject.cs (1)
36if (this.TryGetOwnerAs(out Control? owner) && owner is IDataGridViewEditingControl editingControl
System\Windows\Forms\Controls\DataGridView\DataGridViewEditingControlShowingEventArgs.cs (2)
10public DataGridViewEditingControlShowingEventArgs(Control control, DataGridViewCellStyle cellStyle) 16public Control Control { get; }
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
470Control.MouseButtons == MouseButtons.Left &&
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
157s_defaultHeight = Control.DefaultFont.Height + 9;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.DataGridViewTextBoxEditingControlAccessibleObject.cs (1)
42if (this.TryGetOwnerAs(out Control? owner) && owner is IDataGridViewEditingControl editingControl
System\Windows\Forms\Controls\DataGridView\IDataGridColumnStyleEditingNotificationService.cs (1)
8void ColumnStartedEditing(Control editingControl);
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (1)
50public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
System\Windows\Forms\Controls\Labels\Label.cs (2)
659get => ((Control)this).RenderTransparent; 1362Control? parent = ParentInternal;
System\Windows\Forms\Controls\ListView\ListView.cs (2)
3514internal override unsafe ToolInfoWrapper<Control> GetToolInfoWrapper(TOOLTIP_FLAGS flags, string? caption, ToolTip tooltip) 3521ToolInfoWrapper<Control> wrapper = new(this, flags, isExternalTooltip ? null : caption);
System\Windows\Forms\Controls\ListView\ListViewItem.cs (1)
399return Control.DefaultFont;
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (2)
68bool IKeyboardToolTip.IsBeingTabbedTo() => Control.AreCommonNavigationalKeysDown(); 70bool IKeyboardToolTip.IsHoveredWithMouse() => _listView?.AccessibilityObject.Bounds.Contains(Control.MousePosition) ?? false;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (1)
150return _owner?._listView?.Font ?? Control.DefaultFont;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarChildAccessibleObject.cs (1)
61!_monthCalendarAccessibleObject.TryGetOwnerAs(out Control? owner)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (5)
1958private static void DrawXorBar(Control targetControl, Rectangle rcFrame) 2193internal Control? GetElementFromPoint(Point point) 2391if (ShouldForwardChildMouseMessage((Control?)sender, e, ref newPoint)) 2407if (ShouldForwardChildMouseMessage((Control?)sender, e, ref newPoint)) 4084private bool ShouldForwardChildMouseMessage(Control? child, MouseEventArgs e, ref Point point)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyGridAccessibleObject.cs (1)
31Control? element = owningPropertyGrid.GetElementFromPoint(clientPoint);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1478return Control.DefaultFont;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (2)
50foreach (Control control in Controls) 313Control? parent = _detailsButton.Parent;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridToolTip.cs (10)
8private readonly Control[] _controls; 13internal GridToolTip(Control[] controls) 63ToolInfoWrapper<Control> info = GetTOOLINFO(_controls[i]); 96private ToolInfoWrapper<Control> GetTOOLINFO(Control c) 99private void OnControlCreateHandle(object? sender, EventArgs e) => SetupToolTip((Control?)sender); 105GetTOOLINFO((Control)sender).SendMessage(this, PInvoke.TTM_DELTOOLW); 121private void SetupToolTip(Control? control) 131ToolInfoWrapper<Control> info = GetTOOLINFO(control); 157ToolInfoWrapper<Control> info = GetTOOLINFO(_controls[i]);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.HelpPaneAccessibleObject.cs (1)
54if (this.TryGetOwnerAs(out Control? owner))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (16)
84private Control? _currentEditor; 893private void CommonEditorSetup(Control control) 899private void CommonEditorUse(Control control, Rectangle targetRectangle) 1429public void DropDownControl(Control control) 1522Control? control = _dropDownHolder.Component; 2066private bool IsMyChild(Control? control) 2073Control? parent = control.ParentInternal; 2102internal static bool IsSiblingControl(Control control1, Control control2) 2104Control? parent1 = control1.ParentInternal; 2105Control? parent2 = control2.ParentInternal; 2648private bool OnEscape(Control sender) 3815internal static void PositionTooltip(Control parent, GridToolTip toolTip, Rectangle itemRect) 3871Control? focusedControl = FromHandle(PInvoke.GetFocus()); 4355Control button = needsDropDownButton ? DropDownButton : DialogButton; 4885Control topControl = this;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (3)
15private Control? _currentControl; // the control that is hosted in the holder 176public Control? Component => _currentControl; 553public void SetDropDownControl(Control? control, bool resizable)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.GridViewTextBox.GridViewTextBoxAccessibleObject.cs (1)
70UIA_PROPERTY_ID.UIA_HasKeyboardFocusPropertyId => (VARIANT)(this.TryGetOwnerAs(out Control? owner) && owner.Focused),
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.MouseHook.cs (3)
13private readonly Control _control; 25public MouseHook(Control control, IMouseHookClient client, PropertyGridView gridView) 165&& FromHandle(hwnd) is Control targetControl
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.PropertyGridViewAccessibleObject.cs (1)
25=> this.IsOwnerHandleCreated(out Control? _) ? HitTest((int)x, (int)y) : null;
System\Windows\Forms\Controls\Splitter\Splitter.cs (11)
32private Control? _splitTarget; 555private Rectangle CalcSplitLine(Control splitTarget, int splitSize, int minWeight) 603Control? target = FindTarget(); 624Control? target = FindTarget(); 640Control? parent = ParentInternal; 651Control ctl = children[i]; 712private Control? FindTarget() 714Control? parent = ParentInternal; 725Control target = children[i]; 768private int GetSplitSize(Control splitTarget, int x, int y) 955private void SplitMove(Control splitTarget, int x, int y)
System\Windows\Forms\Controls\Splitter\Splitter.SplitData.cs (1)
15internal Control? _target;
System\Windows\Forms\Controls\TabControl\TabControl.ControlCollection.cs (3)
10public new class ControlCollection : Control.ControlCollection 19public override void Add(Control? value) 66public override void Remove(Control? value)
System\Windows\Forms\Controls\TabControl\TabControl.cs (2)
955protected override Control.ControlCollection CreateControlsInstance() 1051public Control GetControl(int index)
System\Windows\Forms\Controls\TabControl\TabPage.cs (4)
489internal override void AssignParent(Control? value) 505Control? c = comp as Control; 732Control? parent = ParentInternal;
System\Windows\Forms\Controls\TabControl\TabPage.TabPageControlCollection.cs (1)
27public override void Add(Control? value)
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (3)
1836/// Raises the <see cref="Control.KeyDown"/> event. 1948/// Raises the <see cref="Control.KeyPress"/> event. 2017/// Raises the <see cref="Control.KeyUp"/> event.
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseAccessibleObject.cs (3)
73=> this.TryGetOwnerAs(out Control? owner) && owner.Text is { } text ? text : string.Empty; 77if (!this.IsOwnerHandleCreated(out Control? _)) 89if (this.TryGetOwnerAs(out Control? owner))
System\Windows\Forms\Controls\ToolStrips\OpacityConverter.cs (1)
48if (!Control.UseComponentModelRegisteredTypes)
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
140private Control RTLGrip
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (7)
2425internal virtual Control GetOwnerControl() 3851public new Control? GetChildAtPoint(Point point) => base.GetChildAtPoint(point); 3854public new Control? GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue) => base.GetChildAtPoint(pt, skipValue); 3859internal override Control? GetFirstChildControlInTabOrder(bool forward) => null; 4001Control? control = FromHandle(_hwndThatLostFocus); 4586Control? previousControl = FromChildHandle(previousFocus); 4598Control? nextControl = FromChildHandle(nextFocus);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObject.cs (1)
194bool ShouldItemBeSkipped(Control hostedControl)
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (3)
39public ToolStripComboBox(Control c) 404protected override void OnSubscribeControlEvents(Control? control) 420protected override void OnUnsubscribeControlEvents(Control? control)
System\Windows\Forms\Controls\ToolStrips\ToolStripContainer.cs (3)
379foreach (Control c in Controls) 385foreach (Control c in Controls) 396foreach (Control c in Controls)
System\Windows\Forms\Controls\ToolStrips\ToolStripContainer.ToolStripContainerTypedControlCollection.cs (3)
22public override void Add(Control? value) 43public override void Remove(Control? value) 59internal override void SetChildIndexInternal(Control child, int newIndex)
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (7)
16private Control _control; 34public ToolStripControlHost(Control c) 50public ToolStripControlHost(Control c, string name) 121public Control Control => _control; 126private Control ControlInternal 706protected virtual void OnSubscribeControlEvents(Control? control) 751protected virtual void OnUnsubscribeControlEvents(Control? control)
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.ToolStripHostedControlAccessibleObject.cs (3)
16public class ToolStripHostedControlAccessibleObject : Control.ControlAccessibleObject 19private readonly Control _toolStripHostedControl; 26public ToolStripHostedControlAccessibleObject(Control toolStripHostedControl, ToolStripControlHost? toolStripControlHost) : base(toolStripHostedControl)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (6)
751internal Control? SourceControlInternal 753get => Properties.GetValueOrDefault<Control>(s_propSourceControl); 1475foreach (Control control in Controls) 1813public void Show(Control control, Point position) 1829public void Show(Control control, Point position, ToolStripDropDownDirection direction) 1838public void Show(Control control, int x, int y)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
131if ((Control.ModifierKeys != Keys.Alt) && 152if ((Control.ModifierKeys != Keys.Alt) &&
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (2)
106return (Control.MouseButtons == MouseButtons.Left) && (Control.ModifierKeys == Keys.None);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (7)
520Control? parent = ParentInternal; 526return Control.DefaultBackColor; 874Control? parent = ParentInternal; 880return Control.DefaultForeColor; 2060if (Control.ModifierKeys == Keys.Alt) 3589=> ((IKeyboardToolTip)this).GetNativeScreenRectangle().Contains(Control.MousePosition); 3627internal virtual bool IsBeingTabbedTo() => Control.AreCommonNavigationalKeysDown();
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemAccessibleObject.cs (1)
94/// <see cref="Control.Handle" /> is not.
System\Windows\Forms\Controls\ToolStrips\ToolStripItemClickedEventHandler.cs (3)
7/// Represents a method that will handle the <see cref="Control.MouseDown"/>, 8/// <see cref="Control.MouseUp"/> or <see cref="Control.MouseMove"/> events of a form,
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (14)
56return Control.DefaultFont; 105sysFont ??= Control.DefaultFont; 260private static bool IsOnSameWindow(Control control1, Control control2) 570internal static ToolStripPanel? ToolStripPanelFromPoint(Control draggedControl, Point screenLocation) 748Control? activeControl = Control.FromChildHandle(m.HWnd); 749Control? activeControlInChain = activeControl; 838if (Control.FromHandle(rootWindowOfControl) is Form mainForm && mainForm.IsMdiContainer) 881Control? intendedControl = Control.FromHandle(m.HWnd); 882Control? toplevelControl = null; 951internal static MenuStrip? GetMainMenuStrip(Control control) 970private static MenuStrip? GetFirstMenuStripRecursive(Control.ControlCollection controlsToLookIn)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (13)
83Control? control = null; 88control = Control.FromHandle(_activeHwnd.Handle); 95control = Control.FromHandle(_activeHwnd.Handle); 135ActiveHwndInternal = new(Control.FromHandle(hwndActive), hwndActive); 191Control? control = Control.FromHandle(ActiveHwnd.Handle); 251ActiveHwndInternal = new(sender as Control); 258if (Control.FromHandle(m.HWnd) is ToolStrip toolStrip && !toolStrip.IsDropDown) 405ActiveHwndInternal = new(Control.FromHandle(hwndActive), hwndActive); 528var activeWindowHandle = Control.GetHandleRef(PInvoke.GetActiveWindow()); 538else if (Control.FromChildHandle(activeWindowHandle.Handle) is not ToolStripDropDown 567Control? control = Control.FromChildHandle(m.HWnd);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (4)
123_targetWindowHandle = Control.GetSafeHandle(targetWindow); 199if (Control.UseComponentModelRegisteredTypes) 1083_targetWindowHandle = Control.GetSafeHandle(window); 1101if (!Control.UseComponentModelRegisteredTypes)
System\Windows\Forms\Controls\ToolStrips\ToolStripNumericUpDown.ToolStripNumericUpDownControl.ToolStripNumericUpDownAccessibleObject.cs (1)
15public ToolStripNumericUpDownAccessibleObject(Control toolStripHostedControl, ToolStripControlHost? toolStripControlHost)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (8)
482if (e.AffectedComponent != ParentInternal && e.AffectedComponent as Control is not null) 521Control[] controls = new Control[Controls.Count]; 526foreach (Control control in row.ControlsInternal) 620Control[] controlArray = new Control[controls.Count]; 1079foreach (Control c1 in Controls) 1081foreach (Control c2 in Controls)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelControlCollection.cs (1)
20internal override void AddInternal(Control? value)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelControlCollection.XYComparer.cs (4)
18Control? one = first as Control; 19Control? two = second as Control;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelControlCollection.YXComparer.cs (4)
19Control? one = first as Control; 20Control? two = second as Control;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (3)
35public ToolStripPanelCell(Control control) 40public ToolStripPanelCell(ToolStripPanelRow? parent, Control control) 72public Control Control
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (6)
72public Control[] Controls 76Control[] controls = new Control[ControlsInternal.Count]; 221internal Control ParentInternal 292protected internal virtual void OnControlAdded(Control control, int index) 316protected internal virtual void OnControlRemoved(Control control, int index)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (2)
383protected internal override void OnControlAdded(Control control, int index) 387protected internal override void OnControlRemoved(Control control, int index)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.cs (18)
39public ToolStripPanelRowControlCollection(ToolStripPanelRow owner, Control[] value) 45public new virtual Control this[int index] 72public int Add(Control value) 88public void AddRange(params Control[] value) 109public bool Contains(Control value) 147private Control GetControl(int index) 158private int IndexOfControl(Control c) 182void IList.Remove(object? value) { Remove((Control)value!); } 184int IList.Add(object? value) { return Add((Control)value!); } 186int IList.IndexOf(object? value) { return IndexOf((Control)value!); } 188void IList.Insert(int index, object? value) { Insert(index, (Control)value!); } 190public int IndexOf(Control value) 204public void Insert(int index, Control value) 220private void OnAfterRemove(Control control, int index) 249if (controlToBeDragged is Control control) 264public void Remove(Control value) 275Control control = GetControl(index); 282public void CopyTo(Control[] array, int index)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowManager.cs (3)
26foreach (Control control in Row.ControlsInternal) 184protected internal virtual void OnControlAdded(Control c, int index) 188protected internal virtual void OnControlRemoved(Control c, int index)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (2)
390protected internal override void OnControlRemoved(Control c, int index) 394protected internal override void OnControlAdded(Control control, int index)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (3)
1117private static void RenderBackgroundGradient(Graphics g, Control control, Color beginColor, Color endColor) 1123private static void RenderBackgroundGradient(Graphics g, Control control, Color beginColor, Color endColor, Orientation orientation) 1137Control? parent = control.ParentInternal;
System\Windows\Forms\Controls\ToolStrips\ToolStripProgressBar.cs (2)
250protected override void OnSubscribeControlEvents(Control? control) 261protected override void OnUnsubscribeControlEvents(Control? control)
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
1157internal static bool ShouldPaintBackground(Control control) =>
System\Windows\Forms\Controls\ToolStrips\ToolStripRendererSwitcher.cs (3)
21public ToolStripRendererSwitcher(Control owner, ToolStripRenderMode defaultRenderMode) : this(owner) 27public ToolStripRendererSwitcher(Control owner) 153if (sender is Control control)
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (7)
139foreach (Control c in toolStripPanel.Controls) 232private void FindControls<T>(bool searchAllChildren, Control.ControlCollection controlsToLookIn, List<T> foundControls) 233where T : Control 285private static void ResumeAllLayout(Control start, bool performLayout) 287Control.ControlCollection controlsCollection = start.Controls; 297private static void SuspendAllLayout(Control start) 301Control.ControlCollection controlsCollection = start.Controls;
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.cs (3)
47public ToolStripTextBox(Control c) 122protected override void OnSubscribeControlEvents(Control? control) 139protected override void OnUnsubscribeControlEvents(Control? control)
System\Windows\Forms\Controls\TreeView\TreeNode.IKeyboardToolTip.cs (2)
43bool IKeyboardToolTip.IsBeingTabbedTo() => Control.AreCommonNavigationalKeysDown(); 45bool IKeyboardToolTip.IsHoveredWithMouse() => TreeView?.AccessibilityObject.Bounds.Contains(Control.MousePosition) ?? false;
System\Windows\Forms\Controls\TreeView\TreeView.cs (2)
2887internal override unsafe ToolInfoWrapper<Control> GetToolInfoWrapper(TOOLTIP_FLAGS flags, string? caption, ToolTip tooltip) 2894ToolInfoWrapper<Control> wrapper = new(this, flags, isExternalTooltip ? null : caption);
System\Windows\Forms\Controls\Unsupported\ContextMenu\ContextMenu.cs (4)
37public Control SourceControl => throw null; 55protected internal virtual bool ProcessCmdKey(ref Message msg, Keys keyData, Control control) => throw null; 57public void Show(Control control, Point pos) { } 59public void Show(Control control, Point pos, LeftRightAlignment alignment) { }
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGrid.cs (1)
534protected internal virtual void ColumnStartedEditing(Control editingControl) { }
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGridColumnStyle.cs (2)
222void IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control editingControl) { } 224protected internal virtual void ColumnStartedEditing(Control editingControl) { }
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (1)
327/// Handles the <see cref="Control.KeyPress"/>
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (8)
588/// Raises the <see cref="Control.KeyDown"/> event. 618/// Raises the <see cref="Control.KeyPress"/> event. 624/// Raises the <see cref="Control.LostFocus"/> event. 635/// Raises the <see cref="Control.Resize"/> event. 675/// Raises the <see cref="Control.OnMouseDown"/> event. 688/// Raises the <see cref="Control.OnMouseUp"/> event. 716/// Raises the <see cref="Control.OnMouseWheel"/> event. 898private MouseEventArgs TranslateMouseEvent(Control child, MouseEventArgs e)
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownEdit.cs (1)
101/// Raises the <see cref="Control.KeyUp"/> event.
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (3)
360/// <see cref="Control"/>. 465Control? parent = ParentInternal; 1140for (Control? control = this; control is not null; control = control.ParentInternal)
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (13)
21private readonly HashSet<Control> _containerCache = []; 22private HashSet<Control>? _components; 158HashSet<Control>? components = GetComponents(); 164foreach (Control ctl in components.ToArray()) 184private HashSet<Control>? GetComponents() 214if (comp is Control ctrl && comp != _parent && comp.Site is not null) 227Control[] ctls = [.. _containerCache]; 248private void GetAllChildren(Control ctl) 262foreach (Control c in ctl.Controls) 291if (sender == _associatedContainer && e.Component is Control c) 300internal void AddControl(Control ctl) 321internal void RemoveControl(Control ctl) 351internal static string GetNameForControl(Control ctl)
System\Windows\Forms\Controls\WebBrowser\WebBrowserHelper.cs (1)
92internal static ISelectionService? GetSelectionService(Control ctl)
System\Windows\Forms\DataBinding\Binding.cs (3)
176public Control? Control => BindableComponent as Control; 185return component is not Control control || control.Created;
System\Windows\Forms\DataBinding\ControlBindingsCollection.cs (2)
26public Control? Control => _control as Control;
System\Windows\Forms\DataBinding\ICommandBindingTargetProvider.cs (1)
78/// also raises the <see cref="Control.Click"/> Event of that Button, which
System\Windows\Forms\Design\ComponentEditorForm.ComponentEditorPageSite.cs (3)
19internal Control _parent; 27internal ComponentEditorPageSite(Control parent, Type pageClass, IComponent component, ComponentEditorForm form) 97public Control GetControl()
System\Windows\Forms\Design\ComponentEditorPage.cs (1)
154public virtual Control GetControl() => this;
System\Windows\Forms\Design\IWindowsFormsEditorService.cs (1)
53void DropDownControl(Control control);
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (3)
98Rectangle screen = Screen.GetWorkingArea(Control.MousePosition); 199ownerHwnd = Control.GetSafeHandle(owner); 204ownerHwnd = Control.GetHandleRef(PInvoke.GetActiveWindow());
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (1)
728if (Control.CheckForIllegalCrossThreadCalls && Application.OleRequired() != ApartmentState.STA)
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (1)
448if (Control.CheckForIllegalCrossThreadCalls && Application.OleRequired() != ApartmentState.STA)
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (2)
139Font? result = _font ?? Control.DefaultFont; 450private bool ShouldSerializeFont() => !Font.Equals(Control.DefaultFont);
System\Windows\Forms\Dialogs\MessageBox.cs (2)
459handle = owner is null ? Control.GetHandleRef(PInvoke.GetActiveWindow()) : Control.GetSafeHandle(owner);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (1)
215if (Control.CheckForIllegalCrossThreadCalls && InvokeRequired)
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.ControlItemAccessibleObject.cs (2)
18private readonly Control _control; 24Control control,
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.cs (2)
17private readonly Control _control; 29public ControlItem(ErrorProvider provider, Control control, IntPtr id)
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (18)
17[ProvideProperty("IconPadding", typeof(Control))] 18[ProvideProperty("IconAlignment", typeof(Control))] 19[ProvideProperty("Error", typeof(Control))] 25private readonly Dictionary<Control, ControlItem> _items = []; 26private readonly Dictionary<Control, ErrorWindow> _windows = []; 420if (errBindings[j].Control is Control control) 465Dictionary<Control, string> controlError = new(bindingsCount); 470if (errBindings[j].Control is not Control control) 498foreach (KeyValuePair<Control, string> entry in controlError) 671return extendee is Control and not Form; 702private ControlItem EnsureControlItem(Control control) 718internal ErrorWindow EnsureErrorWindow(Control parent) 736public string GetError(Control control) => EnsureControlItem(control).Error; 745public ErrorIconAlignment GetIconAlignment(Control control) => EnsureControlItem(control).IconAlignment; 754public int GetIconPadding(Control control) => EnsureControlItem(control).IconPadding; 772public void SetError(Control control, string? value) 796public void SetIconAlignment(Control control, ErrorIconAlignment value) 804public void SetIconPadding(Control control, int padding)
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (2)
23private readonly Control _parent; 32public ErrorWindow(ErrorProvider provider, Control parent)
System\Windows\Forms\Form.AccessibleObject.cs (2)
21public override Rectangle Bounds => this.IsOwnerHandleCreated(out Control? owner) 26=> !this.IsOwnerHandleCreated(out Control? owner)
System\Windows\Forms\Form.ControlCollection.cs (3)
11public new class ControlCollection : Control.ControlCollection 29public override void Add(Control? value) 61public override void Remove(Control? value)
System\Windows\Forms\Form.cs (21)
542Control toLayout = DesignMode || ParentInternal is null ? this : ParentInternal; 1705internal override Control? ParentInternal 3155internal override void AssignParent(Control? value) 3304protected override Control.ControlCollection CreateControlsInstance() 3313internal override void AfterControlRemoved(Control control, Control oldParent) 3700Control? mdiclient = MdiParentInternal.MdiClient; 3872Control ctl = Controls[index]; 4133Control? activeControl = ActiveControl; 4315foreach (Control c in Controls) 4394Control button = (Control)AcceptButton; 4649foreach (Control c in Controls) 4744if (button is Control) 5161foreach (Control control in Controls) 5408/// Displays the form by setting its <see cref="Control.Visible"/> property to <see langword="true"/>. 5428/// This method makes the form visible by setting the <see cref="Control.Visible"/> property to <see langword="true"/>. 5471if (owner is Control ownerControl) 5502/// Displays the form asynchronously, by setting its <see cref="Control.Visible"/> property to <see langword="true"/>. 5512/// This method makes the form visible by setting the <see cref="Control.Visible"/> property to <see langword="true"/>. 5697if (owner is Control ownerControl)
System\Windows\Forms\GiveFeedbackEventArgs.cs (1)
11/// Provides data for the <see cref="Control.GiveFeedback"/> event.
System\Windows\Forms\GiveFeedbackEventHandler.cs (2)
7/// Represents a method that handles the <see cref="Control.GiveFeedback"/> 8/// event of a <see cref="Control"/>.
System\Windows\Forms\Help\Help.cs (10)
22public static void ShowHelp(Control? parent, string? url) 30public static void ShowHelp(Control? parent, string? url, HelpNavigator navigator) 38public static void ShowHelp(Control? parent, string? url, string? keyword) 53public static void ShowHelp(Control? parent, string? url, HelpNavigator command, object? parameter) 69public static void ShowHelpIndex(Control? parent, string? url) 77public static unsafe void ShowPopup(Control? parent, string caption, Point location) 102private static unsafe void ShowHTML10Help(Control? parent, string? url, HelpNavigator command, object? param) 137HandleRef<HWND> handle = parent is not null ? (new(parent)) : Control.GetHandleRef(PInvoke.GetActiveWindow()); 194private static void ShowHTMLFile(Control? parent, string? url, HelpNavigator command, object? param) 214HandleRef<HWND> handle = parent is not null ? new(parent) : Control.GetHandleRef(PInvoke.GetActiveWindow());
System\Windows\Forms\Help\HelpEventHandler.cs (2)
7/// Represents a method that will handle the <see cref="Control.HelpRequested"/> event of a <see cref="Control"/>.
System\Windows\Forms\Help\HelpProvider.cs (24)
12[ProvideProperty("HelpString", typeof(Control))] 13[ProvideProperty("HelpKeyword", typeof(Control))] 14[ProvideProperty("HelpNavigator", typeof(Control))] 15[ProvideProperty("ShowHelp", typeof(Control))] 20private readonly Dictionary<Control, string?> _helpStrings = []; 21private readonly Dictionary<Control, bool> _showHelp = []; 22private readonly List<Control> _boundControls = []; 23private readonly Dictionary<Control, string?> _keywords = []; 24private readonly Dictionary<Control, HelpNavigator> _navigators = []; 55public virtual bool CanExtend(object? target) => target is Control; 63public virtual string? GetHelpKeyword(Control ctl) 75public virtual HelpNavigator GetHelpNavigator(Control ctl) 87public virtual string? GetHelpString(Control ctl) 98public virtual bool GetShowHelp(Control ctl) 109if (sender is not Control ctl) 123if (Control.MouseButtons != MouseButtons.None && !string.IsNullOrEmpty(helpString)) 159if (sender is not Control ctl) 172public virtual void SetHelpString(Control ctl, string? helpString) 188public virtual void SetHelpKeyword(Control ctl, string? keyword) 204public virtual void SetHelpNavigator(Control ctl, HelpNavigator navigator) 218public virtual void SetShowHelp(Control ctl, bool value) 229internal bool ShouldSerializeShowHelp(Control ctl) 239public virtual void ResetShowHelp(Control ctl) 249private void UpdateEventBinding(Control ctl)
System\Windows\Forms\IComponentEditorPageSite.cs (1)
14Control GetControl();
System\Windows\Forms\Input\KeyEventArgs.cs (10)
7/// Provides data for the <see cref="Control.KeyDown"/> or 8/// <see cref="Control.KeyUp"/> event. 38/// Gets the keyboard code for a <see cref="Control.KeyDown"/> or 39/// <see cref="Control.KeyUp"/> event. 58/// Gets the keyboard value for a <see cref="Control.KeyDown"/> or 59/// <see cref="Control.KeyUp"/> event. 64/// Gets the key data for a <see cref="Control.KeyDown"/> or 65/// <see cref="Control.KeyUp"/> event. 70/// Gets the modifier flags for a <see cref="Control.KeyDown"/> or 71/// <see cref="Control.KeyUp"/> event.
System\Windows\Forms\Input\KeyEventHandler.cs (3)
7/// Represents a method that will handle the <see cref="Control.KeyUp"/> 8/// or <see cref="Control.KeyDown"/> event of a 9/// <see cref="Control"/>.
System\Windows\Forms\Input\KeyPressEventArgs.cs (2)
7/// Provides data for the <see cref="Control.KeyPress"/> event. 25/// Gets or sets a value indicating whether the <see cref="Control.KeyPress"/> event was handled.
System\Windows\Forms\Input\KeyPressEventHandler.cs (2)
7/// Represents a method that will handle the <see cref="Control.KeyPress"/> 8/// event of a <see cref="Control"/>.
System\Windows\Forms\Input\MouseEventArgs.cs (3)
7/// Provides data for the <see cref="Control.MouseUp"/>, <see cref="Control.MouseDown"/> and 8/// <see cref="Control.MouseMove"/> events.
System\Windows\Forms\Input\MouseEventHandler.cs (3)
7/// Represents a method that will handle the <see cref="Control.MouseDown"/>, 8/// <see cref="Control.MouseUp"/> or <see cref="Control.MouseMove"/> events of a form,
System\Windows\Forms\Input\PreviewKeyDownEventArgs.cs (8)
17/// Gets the key data for a <see cref="Control.KeyDown"/> 18/// or <see cref="Control.KeyUp"/> event. 30/// Gets the keyboard code for a <see cref="Control.KeyDown"/> 31/// or <see cref="Control.KeyUp"/> event. 48/// Gets the keyboard value for a <see cref="Control.KeyDown"/> 49/// or <see cref="Control.KeyUp"/> event. 54/// Gets the modifier flags for a <see cref="Control.KeyDown"/> 55/// or <see cref="Control.KeyUp"/> event.
System\Windows\Forms\Input\PreviewKeyDownEventHandler.cs (2)
7/// Represents a method that will handle <see cref="Control.PreviewKeyDown"/> event of a <see cref="Control"/>.
System\Windows\Forms\Internal\Formatter.cs (2)
141if (!Control.UseComponentModelRegisteredTypes) 157if (!Control.UseComponentModelRegisteredTypes)
System\Windows\Forms\Internal\OwnedObjectExtensions.cs (1)
28where TAs : Control
System\Windows\Forms\Internal\ReadOnlyControlCollection.cs (5)
11internal class ReadOnlyControlCollection : Control.ControlCollection 15public ReadOnlyControlCollection(Control owner, bool isReadOnly) 21public override void Add(Control? value) 36internal virtual void AddInternal(Control? value) => base.Add(value); 48internal virtual void RemoveInternal(Control value) => base.Remove(value);
System\Windows\Forms\Internal\TypedControlCollection.cs (5)
15private readonly Control _ownerControl; 17public TypedControlCollection(Control owner, Type typeOfControl, bool isReadOnly) 24public TypedControlCollection(Control owner, Type typeOfControl) 31public override void Add(Control? value) 39Control.CheckParentingCycle(_ownerControl, value);
System\Windows\Forms\Internal\Win32WindowExtensions.cs (1)
11Control.GetSafeHandle(window),
System\Windows\Forms\Internal\WinFormsUtils.cs (4)
164Control? c = Control.FromHandle(hwnd); 284public static Point TranslatePoint(Point point, Control fromControl, Control toControl)
System\Windows\Forms\Layout\CommonProperties.cs (15)
62/// A control can thwart the layout engine by overriding its virtual <see cref="Control.AutoSize"/> 79/// We can not use our pattern of passing the default value into <see cref="Control.Margin"/> because the 80/// LayoutEngines read this property and do not know each element's <see cref="Control.DefaultMargin"/>. 125/// Typically the padding is accounted for in either the <see cref="Control.DisplayRectangle"/> calculation 126/// and/or the <see cref="Control.GetPreferredSize(Size)"/> calculation of a control. 227using (new LayoutTransaction(element.Container as Control, element, PropertyNames.MinimumSize)) 245/// responsibility to do layout. See <see cref="Control.Padding"/> for details. 264/// The main purpose of this function is to remember what size someone specified in the <see cref="Control.Size"/>, 265/// <see cref="Control.Width"/>, <see cref="Control.Height"/>, <see cref="Control.Bounds"/>, property. (Its the 267/// to <see cref="DockStyle.Fill"/>, then <see cref="DockStyle.None"/>. When filled, the <see cref="Control.Size"/> 342/// <see cref="Control.GetPreferredSizeCore(Size)"/> method. DO NOT CALL DIRECTLY 372/// <see cref="Control.GetPreferredSizeCore(Size)"/> implementation when asked for a constraining 500if (element.Container is Control { LayoutEngine: DefaultLayout })
System\Windows\Forms\Layout\Containers\ContainerControl.cs (41)
16private Control? _activeControl; 21private Control? _focusedControl; 26private Control? _unvalidatedControl; 283public Control? ActiveControl 384bool IContainerControl.ActivateControl(Control control) 389internal bool ActivateControl(Control control) 394internal bool ActivateControl(Control? control, bool originator) 400Control? parent = ParentInternal; 436Control? ctl = null; 464internal virtual void AfterControlRemoved(Control control, Control oldParent) 506Control? parent = cc.ParentInternal; 530private bool AssignActiveControlInternal(Control? value) 607private static void EnableRequiredScaling(Control start, bool enable) 610foreach (Control c in start.Controls) 640Control? parent = containerControl.ParentInternal; 660Control? parentControl = Parent; 794internal override void OnChildLayoutResuming(Control child, bool performLayout) 1025internal static void ResumeAllLayout(Control start, bool performLayout) 1043internal static void SuspendAllLayout(Control start) 1064internal override void Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl, bool causedByFontChanged = false) 1158Control? group = this; 1250Control? start = ActiveControl; 1267Control? ctl = start; 1319private static ScrollableControl? FindScrollableParent(Control ctl) 1321Control? current = ctl.ParentInternal; 1332Control? last = _activeControl; 1449internal void SetActiveControl(Control? value) 1538Control? pathControl = _focusedControl; 1545Control? nextControlDown = _activeControl; 1548Control? parent = nextControlDown!.ParentInternal; 1557Control? priorFocusedControl = _focusedControl = pathControl; 1587Control? stopControl = null; 1622Control leaveControl = pathControl; 1674private void EnsureUnvalidatedControl(Control? candidate) 1727private void EnterValidation(Control enterControl) 1751Control? commonAncestor = enterControl; 1814Control? controlToValidate = _unvalidatedControl ?? _focusedControl; 1862private bool ValidateThroughAncestor(Control? ancestorControl, bool preventFocusChangeOnError) 1887Control? currentActiveControl = _activeControl; 1888Control? currentValidatingControl = _unvalidatedControl;
System\Windows\Forms\Layout\Containers\IContainerControl.cs (2)
14Control? ActiveControl { get; set; } 19bool ActivateControl(Control active);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (11)
64private Control? _nextActiveControl; 1537Control? group = this; 1803Control? parent = ParentInternal; 1825private bool SelectNextControlInContainer(Control? ctl, bool forward, bool tabStopOnly, 1906Control? parent = ParentInternal; 1928private bool SelectNextControlInPanel(Control? ctl, bool forward, bool tabStopOnly, 1995private static void SelectNextActiveControl(Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap) 2026foreach (Control control in sc.Controls) 2031foreach (Control child in control.Controls) 2288internal override void AfterControlRemoved(Control control, Control oldParent)
System\Windows\Forms\Layout\Containers\SplitContainer.SplitContainerTypedControlCollection.cs (2)
22public override void Remove(Control? value) 32internal override void SetChildIndexInternal(Control child, int newIndex)
System\Windows\Forms\Layout\DefaultLayout.cs (13)
7using static System.Windows.Forms.Control; 346return AppContextSwitches.AnchorLayoutV2 && element is Control; 370UpdateAnchorInfoV2((Control)element, ignoreParentSuspendState: true); 524Control control = (Control)element; 670if (container is Control control) 691private static void UpdateAnchorsIteratively(Control control) 726UpdateAnchorsIteratively((Control)element); 831internal static void UpdateAnchorInfoV2(Control control) => UpdateAnchorInfoV2(control, ignoreParentSuspendState: false); 833private static void UpdateAnchorInfoV2(Control control, bool ignoreParentSuspendState) 841Control? parent = control.Parent; 951using (new LayoutTransaction(element.Container as Control, element, PropertyNames.Dock)) 1104(CommonProperties.GetNeedsAnchorLayout(element) || (UseAnchorLayoutV2(element) && ((Control)element)._childControlsNeedAnchorLayout)))
System\Windows\Forms\Layout\FlowLayout.ContainerProxy.cs (1)
39if (_container is Control control)
System\Windows\Forms\Layout\FlowLayout.cs (1)
311if (container is Control flp && flp.Site is not null && flp.Site.DesignMode)
System\Windows\Forms\Layout\LayoutEventArgs.cs (3)
18public LayoutEventArgs(Control? affectedControl, string? affectedProperty) 33public Control? AffectedControl => AffectedComponent as Control;
System\Windows\Forms\Layout\LayoutTransaction.cs (4)
26private readonly Control? _controlToLayout; 32public LayoutTransaction(Control? controlToLayout, IArrangedElement controlCausingLayout, string? property) 37public LayoutTransaction(Control? controlToLayout, IArrangedElement controlCausingLayout, string? property, bool resumeLayout) 71public static IDisposable CreateTransactionIf(bool condition, Control? controlToLayout, IArrangedElement elementCausingLayout, string? property)
System\Windows\Forms\Layout\TableLayout.cs (1)
1182if (containerInfo.Container is Control containerAsControl)
System\Windows\Forms\MDI\MDIClient.ControlCollection.cs (3)
11public new class ControlCollection : Control.ControlCollection 37public override void Add(Control? value) 61public override void Remove(Control? value)
System\Windows\Forms\MDI\MDIClient.cs (2)
129protected override Control.ControlCollection CreateControlsInstance() 163/// Raises the <see cref="Control.Resize" /> event.
System\Windows\Forms\MDI\MDIControlStrip.cs (2)
38if (target is Control controlTarget) 166if (_target is Control controlTarget)
System\Windows\Forms\NotifyIcon.cs (1)
702OnMouseMove(new MouseEventArgs(Control.MouseButtons, 0, 0, 0, 0));
System\Windows\Forms\OLE\DragEventArgs.cs (3)
10/// Provides data for the <see cref="Control.DragDrop"/>, <see cref="Control.DragEnter"/>, 11/// or <see cref="Control.DragOver"/> event.
System\Windows\Forms\OLE\DragEventHandler.cs (4)
7/// Represents a method that will handle the <see cref="Control.DragDrop"/>, 8/// <see cref="Control.DragEnter"/>, or <see cref="Control.DragOver"/> 9/// event of a <see cref="Control"/>.
System\Windows\Forms\OLE\DropTarget.cs (1)
25if (_owner is Control control && control.IsHandleCreated)
System\Windows\Forms\OLE\QueryContinueDragEventArgs.cs (1)
7/// Provides data for the <see cref="Control.QueryContinueDrag"/> event.
System\Windows\Forms\OLE\QueryContinueDragEventHandler.cs (2)
7/// Represents a method that will handle the <see cref="Control.QueryContinueDrag"/> 8/// event of a <see cref="Control"/>.
System\Windows\Forms\OwnerDrawPropertyBag.cs (2)
15private Control.FontHandleWrapper? _fontWrapper; 54_fontWrapper = new Control.FontHandleWrapper(Font);
System\Windows\Forms\Panels\FlowLayoutPanel.cs (4)
9[ProvideProperty("FlowBreak", typeof(Control))] 53bool IExtenderProvider.CanExtend(object obj) => obj is Control control && control.Parent == this; 57public bool GetFlowBreak(Control control) 65public void SetFlowBreak(Control control, bool value)
System\Windows\Forms\Panels\SplitterPanel.cs (1)
209public new Control? Parent
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutControlCollection.cs (2)
14public class TableLayoutControlCollection : Control.ControlCollection 29public virtual void Add(Control control, int column, int row)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (19)
11[ProvideProperty("ColumnSpan", typeof(Control))] 12[ProvideProperty("RowSpan", typeof(Control))] 13[ProvideProperty("Row", typeof(Control))] 14[ProvideProperty("Column", typeof(Control))] 15[ProvideProperty("CellPosition", typeof(Control))] 177obj is Control control && control.Parent == this; 183public int GetColumnSpan(Control control) => 186public void SetColumnSpan(Control control, int value) 197public int GetRowSpan(Control control) => _tableLayoutSettings.GetRowSpan(control); 199public void SetRowSpan(Control control, int value) 212public int GetRow(Control control) => _tableLayoutSettings.GetRow(control); 215public void SetRow(Control control, int row) 227public TableLayoutPanelCellPosition GetCellPosition(Control control) => 231public void SetCellPosition(Control control, TableLayoutPanelCellPosition position) => 240public int GetColumn(Control control) => _tableLayoutSettings.GetColumn(control); 243public void SetColumn(Control control, int column) 252public Control? GetControlFromPosition(int column, int row) => 253(Control?)_tableLayoutSettings.GetControlFromPosition(column, row); 255public TableLayoutPanelCellPosition GetPositionFromControl(Control? control) =>
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.cs (5)
470if (!Control.UseComponentModelRegisteredTypes) 499if (Control.UseComponentModelRegisteredTypes) 501TypeDescriptor.RegisterType<Control>(); 506if (element is Control c) 513if (!Control.UseComponentModelRegisteredTypes)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.TableLayoutSettingsStub.cs (2)
33if (containerInfo.Container is Control appliedControl && _controlsInfo is not null) 44foreach (Control tableControl in appliedControl.Controls)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyle.cs (2)
29if (Owner is Control owner) 51if (Owner is Control owner)
System\Windows\Forms\Printing\PrintPreviewControl.cs (1)
596if (SystemInformation.HighContrast && Parent is Control parent)
System\Windows\Forms\Printing\PrintPreviewDialog.PrintPreviewDialogToolStripButton.cs (1)
11/// See <see cref="Control.ProcessDialogKey"/> for more info.
System\Windows\Forms\Rendering\ControlPaint.cs (2)
2587Control control, 2641Control control,
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (1)
9/// This event is fired by owner drawn <see cref="Control"/> objects, such as <see cref="ListBox"/> and
System\Windows\Forms\Rendering\InvalidateEventArgs.cs (1)
9/// Provides data for the <see cref="Control.Invalidate()"/> event.
System\Windows\Forms\Rendering\InvalidateEventHandler.cs (2)
7/// Represents a method that will handle the <see cref="Control.Invalidate()"/> 8/// event of a <see cref="Control"/>.
System\Windows\Forms\Rendering\PaintEventArgs.cs (3)
11/// Provides data for the <see cref="Control.Paint"/> event. 27/// <item><description>In <see cref="Control.WmPaint(ref Message)"/> when we are painting the background.</description></item> 28/// <item><description>In <see cref="Control.WmPrintClient(ref Message)"/>.</description></item>
System\Windows\Forms\Rendering\PaintEventHandler.cs (2)
7/// Represents a method that will handle the <see cref="Control.Paint"/> event of a <see cref="Control"/> class.
System\Windows\Forms\Screen.cs (3)
265public static Screen FromControl(Control control) 293public static Rectangle GetWorkingArea(Control ctl) => FromControl(ctl).WorkingArea; 308public static Rectangle GetBounds(Control ctl) => FromControl(ctl).Bounds;
System\Windows\Forms\Scrolling\ScrollableControl.cs (6)
341Control current = Controls[i]; 400Control current = Controls[i]; 408Control richCurrent = current; 803Control ctl = Controls[i]; 815public void ScrollControlIntoView(Control? activeControl) 844protected virtual Point ScrollToControl(Control activeControl)
System\Windows\Forms\SendKeys\SendKeys.cs (2)
902private static void Send(string keys, Control? control, bool wait) 981private static void SendWait(string keys, Control? control)
System\Windows\Forms\SystemInformation.cs (1)
165return Control.DefaultFont;
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (2)
22Control? associatedControl, 52public Control? AssociatedControl { get; }
System\Windows\Forms\ToolTip\KeyboardToolTipStateMachine.cs (1)
154return Control.FromHandle(PInvoke.GetFocus());
System\Windows\Forms\ToolTip\PopupEventArgs.cs (2)
17public PopupEventArgs(IWin32Window? associatedWindow, Control? associatedControl, bool isBalloon, Size size) 33public Control? AssociatedControl { get; }
System\Windows\Forms\ToolTip\ToolTip.cs (73)
13[ProvideProperty(nameof(ToolTip), typeof(Control))] 36private readonly Dictionary<Control, TipInfo> _tools = []; 41private Control? _topLevelControl; 50private readonly Dictionary<HWND, Control> _owners = []; 69private readonly HashSet<Control> _created = []; 149internal string? GetCaptionForTool(Control tool) 305if (window is Control control && 475private Control? TopLevelControl 484Control? currentTopLevel = null; 485Control[] controls = [.. _tools.Keys]; 488var control = controls[i]; 617private void AnnounceText(Control? tool, string text) 636Control control = (Control)sender!; 645Control control = (Control)sender!; 676public bool CanExtend(object target) => target is Control; 793Control[] controls = [.. _tools.Keys]; 794foreach (Control control in controls) 802Control[] controls = [.. _tools.Keys]; 803foreach (Control control in controls) 815private void SetToolInfo(Control control, string? caption) 843private void CreateRegion(Control control) 869if (sender is not Control control) 897private void DestroyRegion(Control control) 913new ToolInfoWrapper<Control>(control).SendMessage(this, PInvoke.TTM_DELTOOLW); 972private unsafe ToolInfoWrapper<Control> GetTOOLINFO(Control control, string? caption) 1002return new(Control.GetSafeHandle(window), flags); 1012public string? GetToolTip(Control? control) 1030Control? current = TopLevelControl; 1039Control? currentControl = Control.FromHandle(hwndControl); 1073current = Control.FromHandle(found); 1076current = Control.FromChildHandle(found); 1093Control? control = Control.FromHandle(hwnd); 1147Control[] controls = [.. _tools.Keys]; 1148foreach (Control control in controls) 1205public void SetToolTip(Control control, string? caption) 1214private void SetToolTipInternal(Control control, TipInfo info) 1247ToolInfoWrapper<Control> toolInfo = GetTOOLINFO(control, info!.Caption); 1266private void SetToolTipToControl(Control associatedControl) 1309if (window is Control associatedControl) 1409PInvokeCore.GetWindowRect(Control.GetSafeHandle(window), out var r); 1429PInvokeCore.GetWindowRect(Control.GetSafeHandle(window), out var r); 1447PInvokeCore.GetWindowRect(Control.GetSafeHandle(window), out var r); 1465PInvokeCore.GetWindowRect(Control.GetSafeHandle(window), out var r); 1502if ((tool is Control toolAsControl && _tools.TryGetValue(toolAsControl, out TipInfo? tipInfo)) || 1503(ownerWindow is Control ownerWindowAsControl && _tools.TryGetValue(ownerWindowAsControl, out tipInfo))) 1532ToolInfoWrapper<HandleRef<HWND>> info = new(Control.GetSafeHandle(ownerWindow)); 1729if (win is Control control && control.IsDisposed) 1737ToolInfoWrapper<HandleRef<HWND>> info = new(Control.GetSafeHandle(win)); 1745if (win is not Control tool) 1780Control[] controls = [.. _owners.Values]; 1789Control? tool = window as Control; 1792ToolInfoWrapper<Control> toolInfo = new(tool); 1827if (window is Control windowAsControl) 1955ToolInfoWrapper<Control> toolInfo = default; 1964private Control? GetCurrentToolWindow() 1967return _owners.TryGetValue(hwnd, out Control? control) ? control : Control.FromHandle(hwnd); 1976if (window is not Control windowAsControl || !_tools.TryGetValue(windowAsControl, out TipInfo? tipInfo)) 2001PInvokeCore.GetWindowRect(Control.GetSafeHandle(window), out var r); 2037Control? toolControl = window as Control; 2151if (window is Control windowAsControl && !_tools.TryGetValue(windowAsControl, out tipInfo)) 2225if (window is not Control control || !_tools.TryGetValue(control, out TipInfo? tipInfo)) 2331font = Control.DefaultFont; 2334Control? control = window as Control ?? Control.FromHandle(window.Handle);
System\Windows\Forms\UICuesEventArgs.cs (1)
7/// Provides data for the <see cref="Control.ChangeUICues"/> event.
System\Windows\Forms\UICuesEventHandler.cs (2)
7/// Represents a method that will handle the <see cref="Control.ChangeUICues"/> event of a <see cref="Control"/>.
System\Windows\Forms\UserControl.cs (1)
81Control toLayout = DesignMode || ParentInternal is null ? this : ParentInternal;
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (1)
335public void DrawParentBackground(IDeviceContext dc, Rectangle bounds, Control childControl)
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (2)
13private Control? _controlToSendTo; 34private WindowsFormsSynchronizationContext(Control? marshalingControl, Thread? destinationThread)
System.Windows.Forms.Design (725)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (9)
84&& typeof(Control).IsAssignableFrom(innerType) 352Control ctrlSender = (Control)sender!; 932Control ctrlSender = (Control)sender!; 1015Control ctrlSender = (Control)sender!; 1128private readonly Control _control; 1133public SelectionWrapper(Type collectionType, Type collectionItemType, Control control, ICollection collection)
System\ComponentModel\Design\CollectionEditor.FilterListBox.cs (1)
25foreach (Control c in Parent.Controls)
System\ComponentModel\Design\DesignerActionPanel.cs (2)
878List<Control> newControlList = newLine.GetControls(); 879Control[] controls = [.. newControlList];
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (4)
333private void ShowDropDown(Control hostedControl, Color borderColor) 406void IWindowsFormsEditorService.DropDownControl(Control control) 444public DropDownHolder(Control hostedControl, Control parentControl, Color borderColor, Font font, EditorPropertyLine parent)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (6)
15private readonly Control _hostedControl; 16private readonly Control _parentControl; 18public FlyoutDialog(Control hostedControl, Control parentControl, Color borderColor, Font font) 137public void ShowDropDown(Control parent) 179Control? toplevel = _parentControl.TopLevelControl;
System\ComponentModel\Design\DesignerActionPanel.Line.cs (4)
13protected readonly List<Control> AddedControls = []; 30internal List<Control> GetControls() 33foreach (Control c in AddedControls) 53foreach (Control c in AddedControls)
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
63protected Control? EditControl { get; private set; }
System\ComponentModel\Design\DesignerActionUI.cs (3)
32private Control _marshalingControl; // used to invoke events on our main gui thread 189if (comp is not Control or ToolStripDropDown) 666if (relatedComponent is Control and not ToolStripDropDown)
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (3)
168Control ctrl = (Control)sender!; 259Control? focusedControl = FromChildHandle(focusedControlPtr);
System\ComponentModel\Design\SelectionService.cs (2)
373fToggle = (Control.ModifierKeys & (Keys.Control | Keys.Shift)) > 0; 374fAdd |= Control.ModifierKeys == Keys.Shift;
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (2)
195Windows.Forms.Control? control = value as Windows.Forms.Control;
System\ComponentModel\Design\ToolStripContainerActionList.cs (13)
53foreach (Control control in panel.Controls) 97=> _designerHost?.RootComponent is Control root 113if (_designerHost.RootComponent is Control root && _toolStripContainer.Parent is null) 132if (_designerHost?.RootComponent is not Control root 139Control newParent = _toolStripContainer.ContentPanel; 149Control[] childControls = new Control[root.Controls.Count]; 152foreach (Control control in childControls) 169Control? oldParent = control.Parent; 210private Control GetParent(Control control) 212Control newParent = _toolStripContainer.ContentPanel; 215foreach (Control panel in _toolStripContainer.Controls)
System\Windows\Forms\Design\AnchorEditor.cs (1)
10/// Provides a design-time editor for specifying the <see cref="Control.Anchor"/> property.
System\Windows\Forms\Design\BaseContextMenuStrip.cs (2)
87if (selectionService.PrimarySelection is Control selectedControl && root is not null && selectedControl != root) 89Control? parentControl = selectedControl.Parent;
System\Windows\Forms\Design\Behavior\Behavior.cs (1)
330e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\Behavior\BehaviorService.cs (6)
38private Control? _dropSource; // actual control used to call .dodragdrop 106internal Control AdornerWindowControl => _adornerWindow; 183private Control DropSource => _dropSource ??= new Control(); 265public Point ControlToAdornerWindow(Control c) 294public Rectangle ControlRectInAdornerWindow(Control c) 795if (comp is not Control)
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (8)
17private Control _containerControl; // our related control 32internal ContainerSelectorBehavior(Control containerControl, IServiceProvider serviceProvider) 41internal ContainerSelectorBehavior(Control containerControl, IServiceProvider serviceProvider, bool setInitialDragPoint) 50private void Init(Control containerControl, IServiceProvider serviceProvider) 65public Control ContainerControl 96&& !_containerControl.Equals(selSvc.PrimarySelection as Control)) 216Control? requiredParent = _containerControl.Parent; 222if ((comp is Control ctrl) && (ctrl.Parent is not null))
System\Windows\Forms\Design\Behavior\ControlBodyGlyph.cs (1)
56bool isVisible = _component is not Control control || control.Visible;
System\Windows\Forms\Design\Behavior\DesignerActionGlyph.cs (4)
23private readonly Control? _alternativeParent; // if this is valid - then the glyph will invalidate itself here instead of on the adorner 40public DesignerActionGlyph(DesignerActionBehavior? behavior, Rectangle alternativeBounds, Control? alternativeParent) 48private DesignerActionGlyph(DesignerActionBehavior? behavior, Adorner? adorner, Rectangle alternativeBounds, Control? alternativeParent) 134if (relatedComponent is Control relatedControl && !(relatedComponent is ToolStripDropDown) && _adorner?.BehaviorService is not null)
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (17)
472private bool AddChildCompSnaplines(IComponent comp, List<IComponent>? dragComponents, Rectangle clipBounds, Control? targetControl) 474if (!(comp is Control control) || // has to be a control to get snaplines 484Control c = control; 500private bool AddControlSnaplinesWhenResizing(ControlDesigner designer, Control control, Control? targetControl) 525Control? targetControl = null; 528targetControl = dragComponents[0] as Control; 531Control rootControl = (Control)host.RootComponent; 595if (AddControlSnaplinesWhenResizing(designer, (Control)comp, targetControl)) 608AddControlSnaplinesWhenResizing(internalDesigner, (Control)internalDesigner.Component, targetControl)) 625private static bool IsChildOfParent(Control? child, Control? parent) 632Control? currentParent = child.Parent; 661internal Point OffsetToNearestSnapLocation(Control targetControl, IList targetSnaplines, Point directionOffset) 686internal Point OffsetToNearestSnapLocation(Control targetControl, Point directionOffset) 1085internal Point OnMouseMove(Control targetControl, SnapLine[] snapLines, ref bool didSnap, bool shouldSnapHorizontally)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.BehaviorDataObject.cs (2)
18public BehaviorDataObject(List<IComponent> dragComponents, Control source, DropSourceBehavior sourceBehavior) : base() 26public Control Source { get; }
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (34)
61private Control _suspendedParent; // pointer to the parent that we suspended @ the beginning of the drag 78internal DropSourceBehavior(List<IComponent> dragComponents, Control source, Point initialMouseLocation) 216private void SetDesignerHost(Control c) 218foreach (Control control in c.Controls) 229private void DropControl(int dragComponentIndex, Control dragTarget, Control dragSource, bool localDrag) 231Control currentControl = _dragComponents[dragComponentIndex].dragComponent as Control; 262private void SetLocationPropertyAndChildIndex(int dragComponentIndex, Control dragTarget, Point dropPoint, int newIndex, bool allowSetChildIndexOnDrop) 265if ((propLoc is not null) && (_dragComponents[dragComponentIndex].dragComponent is Control currentControl)) 296if (_data.Target is not Control dragTarget) 339Control dragSource = _data.Source; 448initialDropPoint = ((Control)_dragComponents[_primaryComponentIndex].dragComponent).Parent.PointToClient(initialDropPoint); 453if (((Control)(_dragComponents[_primaryComponentIndex].dragComponent)).Parent.IsMirrored) 455initialDropPoint.Offset(-((Control)(_dragComponents[_primaryComponentIndex].dragComponent)).Width, 0); 459Control primaryComponent = _dragComponents[_primaryComponentIndex].dragComponent as Control; 532List<Control> listOfTrayControls = []; 612Point mouseLoc = Control.MousePosition; 613bool altKeyPressed = Control.ModifierKeys == Keys.Alt; 632Control target = _data.Target as Control; 688Control dragControl = (Control)_dragObjects[i]; 814if (_dragComponents[_primaryComponentIndex].dragComponent is Control c) 865private void GetParentSnapInfo(Control parentControl, BehaviorService bhvSvc) 878if (_dragComponents[_primaryComponentIndex].dragComponent is Control) 929Control primaryControl = _dragObjects[0] as Control; 930Control primaryParent = primaryControl?.Parent; 939Control dragControl = (Control)_dragObjects[i]; 982if (primaryControl.Equals(_dragComponents[i].dragComponent as Control)) 1110if (_dragComponents[i].dragComponent is Control c)
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (12)
21public Control resizeControl; 44private Control _primaryControl; // the primary control the status bar will queue off of 264if (_resizeComponents[0].resizeControl is Control control && control.Parent is not null) 321_primaryControl = selSvc.PrimarySelection as Control; 324List<Control> components = []; 327if (component is Control control) 380Control control = _resizeComponents[i].resizeControl; 424internal static int AdjustPixelsForIntegralHeight(Control control, int pixelsMoved) 464bool altKeyPressed = Control.ModifierKeys == Keys.Alt; 545Control targetControl = _resizeComponents[0].resizeControl; 635Control control = _resizeComponents[i].resizeControl; 837Control parent = control.Parent;
System\Windows\Forms\Design\Behavior\SelectionManager.cs (6)
23private readonly Control _rootComponent; 59_rootComponent = (Control)_designerHost.RootComponent; 114private void AddAllControlGlyphs(Control parent, List<IComponent> selComps, object? primarySelection) 116foreach (Control control in parent.Controls) 135private void AddControlGlyphs(Control control, GlyphSelectionType selType) 261if (g.RelatedComponent is Control control && (dragComps.Contains(g.RelatedComponent) || !control.AllowDrop))
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (5)
276Control? ctl = body.RelatedComponent as Control; 294bool altKeyPressed = Control.ModifierKeys == Keys.Alt; 339Control? baseControl = host.RootComponent as Control;
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (4)
112Control parent = _relatedControl.Parent; 163Control newParent = _relatedControl; 165Control? oldParent = control.Parent; 311? Control.ModifierKeys == Keys.Control
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionGlyph.cs (1)
16private Control? _baseParent;
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (7)
41Control root = _host.RootComponent as Control; 64Control newParent = GetParent(tsc, toolStrip); 66Control oldParent = toolStrip.Parent; 117private static Control GetParent(ToolStripContainer container, ToolStrip c) 119Control newParent = container.ContentPanel; 126foreach (Control panel in container.Controls)
System\Windows\Forms\Design\CollectionEditVerbManager.cs (1)
160void IWindowsFormsEditorService.DropDownControl(Control control)
System\Windows\Forms\Design\CommandSet.cs (47)
481if (comp is Control) 787Control? primaryControl = comp as Control; // this can be null (when we are moving a component in the ComponentTray) 1134if (host.RootComponent is Control baseComponent) 1246Control? viewParent = null; 1269if (obj is Control comp) 1329if (obj is Control comp) 1458Control? commonParent = null; 1481if (obj == host.RootComponent || obj is not Control c) 1489Control? parent = c.Parent; 1515if (obj is Control selectedControl) 1610if (obj is Control c) 1612Control? parent = c.Parent; 1643if (obj is Control control) 1665if (obj is Control selectedControl && commonParent is Control controlCommonParent) 1676Control? parent = controlCommonParent; 1777else if (commonParent is Control controlCommonParent) 1782Control? parent = controlCommonParent.Controls[0]; 1898List<Control> controls = []; 2047Control designerControl = designer.GetControlForComponent(curComp); 2068if (curComp is Control c) 2100List<Control> compsWithControlDesigners = []; 2101foreach (Control c in controls) 2136List<Control> listOfTrayControls = []; 2151foreach (Control c in controls) 2248if (baseComponent is Control) 2397if (baseComponent is not null and Control) 2481if (baseComponent is Control) 2534if (baseComponent is Control) 2917if (obj is not Control) 2940Control? marshalControl = BehaviorService?.AdornerWindowControl; 3228private void UpdatePastePositions(List<Control> controls) 3239Control? parentControl = controls[0].Parent; 3242foreach (Control c in controls) 3302foreach (Control child in parentControl.Controls) 3326Control pasteControl = controls[0]; 3339if (baseComponent is Control) 3409foreach (Control c in controls) 3422private static void UpdatePasteTabIndex(Control componentControl, Control? parentControl) 3435foreach (Control c in parentControl.Controls) 3508if (p is not Control c1 || q is not Control c2) 3517private class TabIndexComparer : IComparer<Control> 3523public int Compare(Control? c1, Control? c2)
System\Windows\Forms\Design\ComponentDocumentDesigner.cs (3)
20public Control Control => throw new NotImplementedException(SR.NotImplementedByDesign); 55Control IOleDragClient.GetDesignerControl() 60Control IOleDragClient.GetControlForComponent(object component)
System\Windows\Forms\Design\ComponentTray.cs (27)
32private List<Control> _controls; // List of items in the tray in the order of their layout. 244Control c = TrayControl.FromComponent(component); 258Control c = TrayControl.FromComponent(comp); 363Control prevCtl = null; 365foreach (Control ctl in _controls) 534Control IOleDragClient.GetDesignerControl() => this; 536Control IOleDragClient.GetControlForComponent(object component) 754if (!compType.IsSubclassOf(typeof(Control))) 970Control c = TrayControl.FromComponent(receiver); 1007foreach (Control control in Controls) 1365Control child = Controls[i]; 1411foreach (Control ctl in _controls) 1439Control c = ((IOleDragClient)this).GetControlForComponent(o); 1688if (rd.GetView(techs[0]) is Control view) 1710internal void UpdatePastePositions(List<Control> components) 1721Control prevCtl = null; 1752Control prevCtl = null; 1777Control prevCtl = null; 1793internal void RearrangeInAutoSlots(Control c, Point pos) 1803private bool PositionInNextAutoSlot(TrayControl c, Control prevCtl, bool dirtyDesigner) 2748internal class AutoArrangeComparer : IComparer<Control> 2750int IComparer<Control>.Compare(Control o1, Control o2) 2823protected override Control GetControl() 2831protected override Control GetControl(IComponent component) 2928if (comp is Control or not IComponent)
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (16)
30List<Control>? suspendedComponents = null; 38if (component is Control control) 67foreach (Control control in suspendedComponents) 81private static bool HasAutoSizedChildren(Control parent) 83foreach (Control child in parent.Controls) 94private static bool HasMixedInheritedChildren(Control parent) 99foreach (Control control in parent.Controls) 120protected virtual bool HasSitedNonReadonlyChildren(Control parent) 127foreach (Control control in parent.Controls) 189Control control = (Control)value; 222if (value is Control control) 237if (component is Control) 278Control? parent = control.Parent; 413private void SerializeZOrder(IDesignerSerializationManager manager, CodeStatementCollection statements, Control control) 421Control child = control.Controls[i];
System\Windows\Forms\Design\ControlCommandSet.cs (61)
21private readonly Control _baseControl; 281Control comp = host.RootComponent as Control; 297HashSet<Control> itemHash = new(sel.Count); 300if (obj is not Control control || control.Site is null) 308Control okParent = null; 312foreach (Control component in sel) 316for (Control parent = component.Parent; parent is not null; parent = parent.Parent) 375Control ctrl = component as Control; 378Control c = ctrl.Parent; 459private List<SnapLine> GenerateSnapLines(SelectionRules rules, Control primaryControl, int directionOffsetX, int directionOffsetY) 610Control primaryControl = comp as Control; 759Control control = component as Control; 970List<Control> layoutParentList = []; 971List<Control> parentList = []; 1009Control control = selectedComponents[i] as Control; 1022control = nestedContainer.Owner as Control; 1030Control parent = control.Parent; 1084Control otherControl = selectedComponents[len - i - 1] as Control; 1090Control control = selectedComponents[i] as Control; 1101foreach (Control parent in parentList) 1111foreach (Control parent in layoutParentList) 1249&& host.RootComponent is Control baseComponent 1266&& host.RootComponent is Control baseComponent 1313if (obj is Control && 1364if (selSvc is null || host is null || !(host.RootComponent is Control)) 1371Control component = selSvc.PrimarySelection as Control; 1372Control current; 1379current = (Control)host.RootComponent; 1401Control nextControl = next as Control; 1424Control ctl; 1425Control baseCtl; 1431if (selSvc is null || host is null || !(host.RootComponent is Control)) 1436baseCtl = (Control)host.RootComponent; 1446ctl = currentSelection as Control; 1499private static Control GetNextControlInTab(Control basectl, Control ctl, bool forward) 1503Control.ControlCollection ctlControls = ctl.Controls; 1507Control found = null; 1526Control found = null; 1527Control p = ctl.Parent; 1535Control.ControlCollection parentControls = p.Controls; 1595Control found = null; 1596Control p = ctl.Parent; 1603Control.ControlCollection parentControls = p.Controls; 1671Control.ControlCollection ctlControls = ctl.Controls; 1675Control found = null; 1722Control cX = x as Control; 1723Control cY = y as Control; 1728Control parent = cX.Parent;
System\Windows\Forms\Design\ControlDesigner.ChildSubClass.cs (1)
58_designer.SetUnhandledException(Control.FromChildHandle(m.HWnd), ex);
System\Windows\Forms\Design\ControlDesigner.ChildWindowTarget.cs (2)
11private readonly Control _childControl; 14public ChildWindowTarget(ControlDesigner designer, Control childControl, IWindowTarget oldWindowTarget)
System\Windows\Forms\Design\ControlDesigner.ControlDesignerAccessibleObject.cs (4)
14private readonly Control _control; 18public ControlDesignerAccessibleObject(ControlDesigner designer, Control control) 67if (_control.AccessibilityObject.GetChild(index) is Control.ControlAccessibleObject childAccObj) 81private AccessibleObject? GetDesignerAccessibleObject(Control.ControlAccessibleObject cao)
System\Windows\Forms\Design\ControlDesigner.cs (37)
115foreach (Control control in Control.Controls) 136public virtual Control Control => (Control)Component; 178Component is Control c && c.Parent is not null ? c.Parent : base.ParentComponent; 530if (Component is not Control ctl) 579protected bool EnableDesignMode(Control child, string name) 607Control rc = Control; 701Control? parent = Control.Parent; 875protected void HookChildControls(Control firstChild) 877foreach (Control child in firstChild.Controls) 911Control? child = sender as Control; 1057if (Component is Control ctl) 1131foreach (Control control in Control.Controls) 1171if (parent is Control parentControl) 1181foreach (Control c in parentControl.Controls) 1247Control control = Control; 1268Control control = Control; 1282Control control = Control; 1295Control control = Control; 1322_ctrlSelect = (Control.ModifierKeys & Keys.Control) != 0; 1347bool shiftSelect = (Control.ModifierKeys & Keys.Shift) != 0; 1428Control? requiredParent = null; 1431if (comp is Control control) 1468Control ctl = Control; 1469Control? parent = ctl; 1497Control ctl = Control; 1498Control? parent = ctl; 1526Control ctl = Control; 1527Control? parent = ctl; 1686protected void UnhookChildControls(Control firstChild) 1690foreach (Control child in firstChild.Controls) 2192if (rd.GetView(techs[0]) is Control view) 2414Control? child = Control.FromHandle(hwndChild); 2482internal void SetUnhandledException(Control? owner, Exception exception) 2510foreach (Control c in Control.Controls)
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollection.cs (7)
16internal class DesignerControlCollection : Control.ControlCollection, IList 18private readonly Control.ControlCollection _realCollection; 20public DesignerControlCollection(Control owner) : base(owner) => _realCollection = owner.Controls; 34public override void Add(Control c) => _realCollection.Add(c); 36public override void AddRange(params Control[] controls) => _realCollection.AddRange(controls); 62public override int GetChildIndex(Control child, bool throwException) 65public override void SetChildIndex(Control child, int newIndex)
System\Windows\Forms\Design\ControlDesigner.DesignerWindowTarget.cs (1)
15Control control = designer.Control;
System\Windows\Forms\Design\DataGridViewDesigner.cs (2)
693internal static void ShowErrorDialog(IUIService? uiService, Exception ex, Control? dataGridView) 712internal static void ShowErrorDialog(IUIService? uiService, string errorString, Control? dataGridView)
System\Windows\Forms\Design\DesignBindingValueUIHandler.cs (1)
34if (context.Instance is Control control)
System\Windows\Forms\Design\DesignerFrame.cs (23)
30private Control? _designer; 71Control designerHolder = _designer; 95public void Initialize(Control view) 116if (selSvc?.PrimarySelection is Control { IsDisposed: false } ctrl) 222int IOverlayService.PushOverlay(Control control) => _designerRegion.PushOverlay(control); 228void IOverlayService.RemoveOverlay(Control control) 236void IOverlayService.InsertOverlay(Control control, int index) 260void ISplitWindowService.AddSplitWindow(Control window) 298void ISplitWindowService.RemoveSplitWindow(Control window) 316foreach (Control c in Controls) 339private readonly List<Control> _overlayList; 372foreach (Control c in _overlayList) 391foreach (Control c in _overlayList) 401private void ParentOverlay(Control control) 415public int PushOverlay(Control control) 433public void RemoveOverlay(Control control) 444public void InsertOverlay(Control control, int index) 447Control c = _overlayList[index]; 462Control overlayControl = _overlayList[i]; 479Control overlayControl = _overlayList[i]; 500foreach (Control c in _overlayList) 511foreach (Control c in _overlayList) 544foreach (Control c in Owner!.Controls)
System\Windows\Forms\Design\DesignerToolStripControlHost.cs (1)
20public DesignerToolStripControlHost(Control c)
System\Windows\Forms\Design\DesignerUtils.cs (5)
312public static void GenerateSnapShot(Control control, out Bitmap image, int borderSize, double opacity, Color backColor) 385public static void GenerateSnapShotWithBitBlt(Control control, out Bitmap image) 420public static bool GenerateSnapShotWithWM_PRINT(Control control, out Bitmap image) 524public static unsafe int GetTextBaseline(Control ctrl, ContentAlignment alignment) 768if (comp is Control { Parent: null })
System\Windows\Forms\Design\DockEditor.cs (1)
10/// Implements the design time editor for specifying the <see cref="Control.Dock"/> property.
System\Windows\Forms\Design\DocumentDesigner.cs (22)
34private List<Control> _suspendedComponents; 230Control IOleDragClient.GetControlForComponent(object component) 232Control c = GetControl(component); 470Point loc = BehaviorService.ControlToAdornerWindow((Control)Component); 471Rectangle translatedBounds = new(loc, ((Control)Component).Size); 558if (sel is null || !(sel is Control)) 566if (obj is Control) 580Debug.Assert(sel is Control, "Our logic is flawed - sel should be a Control"); 581Control c = (Control)sel; 786foreach (Control c in _suspendedComponents) 807if (comp is Control control) 817if (host.RootComponent is Control root) 819Control rootParent = root.Parent; 897bool designableAsControl = ce.Component is Control 1048Control control = Control; 1080Control ctrl = e.Component as Control; 1116if (selObj is Control c) 1126if (svc.PrimarySelection is Control primary) 1151if (obj is Control) 1210properties["DoubleBuffered"] = TypeDescriptor.CreateProperty(typeof(Control), "DoubleBuffered", typeof(bool),
System\Windows\Forms\Design\DocumentDesigner.DocumentInheritanceService.cs (5)
56if (typeof(Control).IsAssignableFrom(memberType)) 60Control? child = null; 63child = (Control?)field.GetValue(component); 67child = (Control?)method.Invoke(component, parameters: null); 70Control parent = _designer.Control;
System\Windows\Forms\Design\EditorServiceContext.cs (1)
117void IWindowsFormsEditorService.DropDownControl(Control control)
System\Windows\Forms\Design\EventHandlerService.cs (3)
21/// <param name="focusWnd">The <see cref="Control"/> which is being designed.</param> 22public EventHandlerService(Control? focusWnd) 36public Control? FocusWindow { get; }
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (10)
28private List<Control> _dragControls; 30private Control _primaryDragControl; 145private Rectangle GetMarginBounds(Control control) 199var currentControl = children[i]; 597Control control = null; 610List<Control> originalControls = []; 615foreach (var dragControl in _dragControls) 645_primaryDragControl = (Control)tempList[j]; 648_dragControls[j] = (Control)tempList[j]; 760_dragControls = [..data.GetSortedDragControls(out int primaryIndex).OfType<Control>()];
System\Windows\Forms\Design\FlowPanelDesigner.cs (1)
37internal override void AddChildControl(Control newChild) => Control.Controls.Add(newChild);
System\Windows\Forms\Design\FormatControl.cs (1)
422for (Control? ctl = Parent; ctl is not null; ctl = ctl.Parent)
System\Windows\Forms\Design\FormatStringDialog.cs (2)
97private static int GetRightSideOffset(Control ctl) 100Control? control = ctl;
System\Windows\Forms\Design\GroupBoxDesigner.cs (1)
77Control control = Control;
System\Windows\Forms\Design\IEventHandlerService.cs (1)
30Control? FocusWindow { get; }
System\Windows\Forms\Design\InheritanceUI.cs (4)
47public void AddInheritedControl(Control c, InheritanceLevel level) 68foreach (Control child in c.Controls) 85public void RemoveInheritedControl(Control c) 93foreach (Control child in c.Controls)
System\Windows\Forms\Design\IOleDragClient.cs (2)
33Control GetDesignerControl(); 39Control GetControlForComponent(object component);
System\Windows\Forms\Design\IOverlayService.cs (3)
22int PushOverlay(Control control); 28void RemoveOverlay(Control control); 33void InsertOverlay(Control control, int index);
System\Windows\Forms\Design\ISplitWindowService.cs (2)
14void AddSplitWindow(Control window); 19void RemoveSplitWindow(Control window);
System\Windows\Forms\Design\ListViewDesigner.cs (1)
186private static void ShowErrorDialog(IUIService uiService, InvalidOperationException ex, Control control)
System\Windows\Forms\Design\NavigationalTableLayoutPanel.cs (1)
15foreach (Control control in Controls)
System\Windows\Forms\Design\OleDragDropHandler.CfCodeToolboxItem.cs (4)
91if (defaultValues["Parent"] is Control parentControl && host.GetDesigner(parentControl) is ParentControlDesigner parentControlDesigner) 98if (component is Control { Parent: null } childControl && childControl != parentControl) 107if (component is Control { Parent: null } childControl and not Form { TopLevel: true }) // Don't add top-level forms 120List<Control>? trayComponents = null;
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (1)
252if (_components[i] is Control c)
System\Windows\Forms\Design\OleDragDropHandler.cs (15)
134public IComponent[] CreateTool(ToolboxItem tool, Control? parent, int x, int y, int width, int height, bool hasLocation, bool hasSize) 139public IComponent[] CreateTool(ToolboxItem tool, Control? parent, int x, int y, int width, int height, bool hasLocation, bool hasSize, ToolboxSnapDragDropEventArgs? e) 298private static void DisableDragDropChildren(ICollection controls, List<Control> allowDropCache) 300foreach (Control c in controls) 325Control parentControl = Destination.GetDesignerControl(); 340Control comp = Destination.GetControlForComponent(comps[i])!; 452if ((rules & SelectionRules.AllSizeable) != SelectionRules.None || Control.MouseButtons == MouseButtons.None) 457Control c = Destination.GetDesignerControl(); 511List<Control> allowDropChanged = []; 514if (comp is Control { HasChildren: true } ctl) 538foreach (Control ctl in allowDropChanged) 751Control? oldDesignerControl = null; 794Control c = Destination.GetControlForComponent(comp)!; 1049Control? c = comp as Control;
System\Windows\Forms\Design\ParentControlDesigner.cs (50)
29private Control _pendingRemoveControl; // we've gotten an OnComponentRemoving, and are waiting for OnComponentRemove 182Control control = Control; 192foreach (Control child in Control.Controls) 261Control control = Control; 270foreach (Control child in Control.Controls) 293protected virtual Control GetParentForComponent(IComponent component) => Control; 408foreach (Control child in Control.Controls) 418internal virtual void AddChildControl(Control newChild) 432internal void AddControl(Control newChild, IDictionary defaultValues) 473Control selectedControl = null; 548Control rootControl = host.RootComponent as Control; 600Control control = GetControl(component); 606Control parent = control; 608Control[] children = new Control[parent.Controls.Count]; 781public virtual bool CanParent(Control control) 861internal List<Control> GetComponentsInRect(Rectangle value, bool screenCoords, bool containRect) 863List<Control> list = []; 868Control control = Control; 873Control child = control.Controls[i]; 891protected Control GetControl(object component) 917Control parent = Control; 998Control parent = Control.Parent; 1041Point loc = BehaviorService.ControlToAdornerWindow((Control)Component); 1042Rectangle translatedBounds = new(loc, ((Control)Component).Size); 1052ContainerSelectorBehavior behavior = new((Control)Component, Component.Site, true); 1075Control parent = Control.Parent; 1259List<Control> selectedControls = parentDesigner.GetComponentsInRect(bounds, true, true /* component should be fully contained*/); 1323Control comp = e.Component as Control; 1459de.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move; 1489Control draggedControl = null; 1540Control ctrl = dragComps[i] as Control; 1660de.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move; 1707Control control = Control; 1880List<Control> selection = GetComponentsInRect(offset, true, false /*component does not need to be fully contained*/); 2021Control control = Control; 2126private void ReParentControls(Control newParent, List<Control> controls, string transactionName, IDesignerHost host) 2145foreach (Control control in controls) 2147Control oldParent = control.Parent; 2268Control control = Control; 2277Control control = Control; 2386Control c = GetControl(component); 2391Control parent = GetParentForComponent(component); 2403Control cParent = c.Parent; 2522Control IOleDragClient.GetDesignerControl() 2532Control IOleDragClient.GetControlForComponent(object component)
System\Windows\Forms\Design\PbrsForward.cs (3)
10private readonly Control _target; 27public PbrsForward(Control target, IServiceProvider sp) 136if ((Control.ModifierKeys & (Keys.Control | Keys.Alt)) != 0)
System\Windows\Forms\Design\PictureBoxDesigner.cs (1)
32Control ctl = Control;
System\Windows\Forms\Design\RichTextBoxDesigner.cs (1)
29Control control = Control;
System\Windows\Forms\Design\SelectionUIHandler.cs (11)
22private Control[]? _dragControls; // the set of controls we're dragging 43_dragControls = new Control[components.Length]; 58private static void CancelControlMove(Control[] controls, BoundsInfo[] bounds) 68Control? parent = controls[i].Parent; 87Control? parent = controls[i].Parent; 135protected abstract Control GetControl(); 140protected abstract Control GetControl(IComponent component); 183Control[] controls = _dragControls!; 244Control? parent = controls[i].Parent; 491Control? parent = controls[i].Parent; 589public BoundsInfo(Control control)
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (2)
66private readonly Control? _control; 138Control parent = _control.Parent;
System\Windows\Forms\Design\SplitContainerDesigner.cs (4)
68protected override Control? GetParentForComponent(IComponent component) => _splitterPanel1; 145List<Control> components = []; 148components.AddRange(panel.Controls.Cast<Control>()); 279public override bool CanParent(Control control) => false;
System\Windows\Forms\Design\SplitterDesigner.cs (1)
25Control control = Control;
System\Windows\Forms\Design\SplitterPanelDesigner.cs (3)
146Control control = Control; 164Control control = Control; 180Control control = Control;
System\Windows\Forms\Design\StatusCommandUI.cs (2)
46if (selectedComponent is Control c) 75if (selectedComponent is Control c)
System\Windows\Forms\Design\StyleEditorForm.cs (1)
22private readonly List<Control> _deleteList;
System\Windows\Forms\Design\TabControlDesigner.cs (7)
110public override bool CanParent(Control control) => (control is TabPage && !Control.Contains(control)); 178if (!(comp is Control)) 183Control c = (Control)comp; 299Control focusWnd = eventSvc.FocusWindow; 494if (!(dragControls[i] is Control) || (dragControls[i] is Control && !(dragControls[i] is TabPage)))
System\Windows\Forms\Design\TableLayoutControlCollectionCodeDomSerializer.cs (4)
66if (serializedObj is not null && !typeof(Control).IsAssignableFrom(o.GetType())) 68serializedObj = new CodeCastExpression(typeof(Control), serializedObj); 74col = tableCollection.Container.GetColumn((Control)o); 75row = tableCollection.Container.GetRow((Control)o);
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (33)
27private Control _localDragControl; // only valid if we're currently dragging a child control of the table 446private void RemoveControlInternal(Control c) 453private void AddControlInternal(Control c, int col, int row) 460private void ControlAddedInternal(Control control, Point newControlPosition, bool localReposition, bool fullTable, DragEventArgs de) 497Control existingControl = ((TableLayoutPanel)Control).GetControlFromPosition(newControlPosition.X, newControlPosition.Y); 565control = temp[0] as Control; 724Control newControl = GetControl(component); 945private Control ExtractControlFromDragEvent(DragEventArgs de) 950return _dragComponents[0] as Control; 1042private Point GetControlPosition(Control control) 1258Point dropPoint = GetCellPosition(Control.MousePosition); 1271Control existingControl = ((TableLayoutPanel)Control).GetControlFromPosition(dropPoint.X, dropPoint.Y); 1278(_localDragControl is not null && existingControl is not null && Control.ModifierKeys == Keys.Control)) 1308Control dragControl = ExtractControlFromDragEvent(de); 1325_droppedCellPosition = GetCellPosition(Control.MousePosition); 1355foreach (Control dragControl in _dragComponents) 1425Control changingControl = e.Component as Control; 1447Control c = e.Component as Control; 1473Control c = comp as Control; 1524_droppedCellPosition = GetCellPosition(Control.MousePosition); 1701foreach (Control child in Table.Controls) 1771internal void FixUpControlsOnDelete(bool isRow, int index, List<Control> deleteList) 1776foreach (Control child in Table.Controls) 1870List<Control> deleteList = []; 1884foreach (Control control in deleteList) 2150public override void Add(Control c) => _realCollection.Add(c); 2152public override void AddRange(Control[] controls) => _realCollection.AddRange(controls); 2184public override void Add(Control control, int column, int row) => _realCollection.Add(control, column, row); 2186public override int GetChildIndex(Control child, bool throwException) => _realCollection.GetChildIndex(child, throwException); 2188public override void SetChildIndex(Control child, int newIndex) => _realCollection.SetChildIndex(child, newIndex);
System\Windows\Forms\Design\TabOrder.cs (37)
21private Control? _ctlHover; 22private List<Control>? _tabControls; 24private HashSet<Control>? _tabComplete; 25private Dictionary<Control, int>? _tabNext; 32private readonly Dictionary<Control, PropertyDescriptor> _tabProperties; 189private void DrawTabs(List<Control> tabs, Graphics graphics, bool fRegion) 210if (_ctlHover.Parent is Control hoverParent) 227foreach (Control control in tabs) 234Control? parent = control; 235Control baseControl = (Control)_host.RootComponent; 293Control rootControl = (Control)_host.RootComponent; 303private Control? GetControlAtPoint(List<Control> tabs, int x, int y) 306Control? ctlFound = null; 307Control? parent; 309foreach (Control control in tabs) 336private Rectangle GetConvertedBounds(Control? control) 338if (control is null || control.Parent is not Control parent) 354private int GetMaxControlCount(Control ctl) 374private Control? GetSitedParent(Control child) 376Control? parent = child.Parent; 403private void GetTabbing(Control control, IList tabs) 410Control ctlTab; 437private bool GetTabbable(Control control) 439for (Control? c = control; c is not null; c = c.Parent) 587Control? ctl = GetControlAtPoint(_tabControls, x, y); 603Control? ctl = null; 649GetTabbing((Control)_host.RootComponent, _tabControls); 718Control? control = _ctlHover; 719Control form = (Control)_host.RootComponent; 733private void SetNewHover(Control? ctl) 760private void SetNextTabIndex(Control ctl) 768Control? parent = GetSitedParent(ctl);
System\Windows\Forms\Design\TabPageDesigner.cs (1)
19Control ctl = Control;
System\Windows\Forms\Design\ToolStripAdornerWindowService.cs (5)
26internal ToolStripAdornerWindowService(IServiceProvider serviceProvider, Control windowFrame) 51internal Control ToolStripAdornerWindowControl 97public Point ControlToAdornerWindow(Control c) 160private Control _designerFrame; // the designer's frame 162internal ToolStripAdornerWindow(Control designerFrame)
System\Windows\Forms\Design\ToolStripCodeDomSerializer.cs (1)
10protected override bool HasSitedNonReadonlyChildren(Control parent)
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (14)
27private Control[]? _panels; 138Control panel = _panels[internalControlIndex]; 151foreach (Control parent in _toolStripContainer!.Controls) 153foreach (Control control in parent.Controls) 188public override bool CanParent(Control control) => false; 203private static ToolStripContainer? ContainerParent(Control control) 233Control currentPanel = _panels![i]; 250if (comp is Control control) 271private static Control? GetAssociatedControl(Component component) 273Control? associatedControl = null; 274if (component is Control control) 281Control? parent = item.GetCurrentParent(); 321Control? associatedControl = GetAssociatedControl(component); 341protected override Control? GetParentForComponent(IComponent component)
System\Windows\Forms\Design\ToolStripDesigner.cs (8)
1304Control parent = ToolStrip.Parent; 1351Point loc = BehaviorService.ControlToAdornerWindow((Control)Component); 1352Rectangle translatedBounds = new(loc, ((Control)Component).Size); 1480Control parent = defaultValues is not null ? defaultValues["Parent"] as Control : null; 1557foreach (Control c in parent.Controls) 1578foreach (Control c in parent.Controls) 2297: (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (4)
264if (_host.RootComponent is Control form) 292if (_host.RootComponent is not Control) 380if (_host.RootComponent is Control form) 639Control parent = _designMenu.Parent;
System\Windows\Forms\Design\ToolStripEditorManager.cs (2)
122private readonly Control _wrappedEditor; 125public ToolStripEditorControl(Control editorToolStrip, Rectangle bounds)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (6)
29private Control _dropSource; 37private Control DropSource 352bool removeSel = (Control.ModifierKeys & (Keys.Control | Keys.Shift)) > 0; 381bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0; 447else if (shiftPressed || (Control.ModifierKeys & Keys.Control) > 0) 874e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripItemDesigner.cs (8)
294else if (startComp is Control) 296Control selectedControl = startComp as Control; 297Control parentControl = selectedControl.Parent; 424if (designerHost.RootComponent is Control parent) 498Point loc = b.ControlToAdornerWindow((Control)ImmediateParent); 560Rectangle parentBounds = GetService<BehaviorService>().ControlRectInAdornerWindow((Control)ImmediateParent); 898Point location = behaviorService.ControlToAdornerWindow((Control)ImmediateParent);
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (26)
316private static Control GetNextControlInTab(Control basectl, Control ctl, bool forward) 324Control found = null; 325Control p = ctl.Parent; 330Control.ControlCollection parentControls = p.Controls; 380Control found = null; 381Control p = ctl.Parent; 385Control.ControlCollection parentControls = p.Controls; 683bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0; 728bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0; 1177|| host.RootComponent is not Control) 1190if (currentSelection is Control) 1292|| host.RootComponent is not Control) 1317if (currentSelection is Control) 1647Control current = null; 1652if (selSvc is null || host is null || !(host.RootComponent is Control)) 1658if (selSvc.PrimarySelection is not Control component) 1660component = SelectedDesignerControl as Control; 1674current = (Control)host.RootComponent; 1694if (!(next is Control nextControl) || nextControl.Site is null || nextControl.Site.Container != container) 1737Control ctl; 1738Control baseCtl; 1743if (selSvc is null || host is null || !(host.RootComponent is Control)) 1749baseCtl = (Control)host.RootComponent; 1801ctl = currentSelection as Control;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (3)
1098Control rootControl = ddi.DropDown; 2600e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move; 2615e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
146public override bool CanParent(Control control) 300protected override Control? GetParentForComponent(IComponent component)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (4)
870Control baseComponent = null; 873baseComponent = (Control)_designerHost.RootComponent; 953Control baseComponent = (Control)_designerHost.RootComponent;
WindowsFormsIntegration (27)
System\Windows\Integration\ApplicationInterop.cs (2)
105SWF.Control control = SWF.Control.FromChildHandle(m.HWnd);
System\Windows\Integration\ElementHost.cs (8)
396internal void InvokePaintBackgroundAndPaint(SWF.Control control, SWF.PaintEventArgs args) 645ImeMode ehImeMode = this.ImeMode != ImeMode.NoControl ? this.ImeMode : SWF.Control.PropagatingImeMode; 1530private static SD.Color FindSolidColorParent(Control whichControl) 1532Control control = whichControl; 1607Control topMostParent = null; 1634Control currentControl = _hostControl; 1635Control parentControl = _hostControl.Parent; 1670private bool ShouldSearchWrapForParentControl(Control control)
System\Windows\Integration\ElementHostPropertyMap.cs (1)
66Control parent = host.Parent;
System\Windows\Integration\HostUtils.cs (4)
143internal static void SetBackgroundImage(WinFormsAdapter adapter, Control child, SD.Bitmap image) 171internal static SD.Bitmap GetBitmapOfControl(Control control, ElementHost host) 192internal static SD.Bitmap GetCoveredPortionOfBitmap(Control parentControl, ElementHost childElementHost) 276internal static SD.Bitmap GetBitmapFromRenderTargetBitmap(Control control, RenderTargetBitmap bmp, Point offset)
System\Windows\Integration\WindowsFormsHost.cs (8)
303public Control Child 311Control oldChild = Child; 340private void OnChildChanged(Control oldChild) 721private Control _child; 722public Control Child 915SWF.Control c = this.ActiveControl.Parent; 1084private void CallOnParentRightToLeftChanged(Control control) 1086MethodInfo methodInfo = typeof(SWF.Control).GetMethod("OnParentRightToLeftChanged", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(EventArgs) }, null);
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (4)
78SWF.Control child = windowsFormsHost.Child; 100SWF.Control childControl = GetChildControl(host, FlowDirectionPropertyTranslator, value); 247SWF.Control childControl = GetChildControl(host, PaddingPropertyTranslator, value); 292private SWF.Control GetChildControl(object host, PropertyTranslator translator, object value)