diff --git a/src/System.Windows.Forms.Design/src/Properties/InternalsVisibleTo.cs b/src/System.Windows.Forms.Design/src/Properties/AssemblyInfo.cs
similarity index 92%
rename from src/System.Windows.Forms.Design/src/Properties/InternalsVisibleTo.cs
rename to src/System.Windows.Forms.Design/src/Properties/AssemblyInfo.cs
index df940a06149..2405e39c5ab 100644
--- a/src/System.Windows.Forms.Design/src/Properties/InternalsVisibleTo.cs
+++ b/src/System.Windows.Forms.Design/src/Properties/AssemblyInfo.cs
@@ -4,6 +4,8 @@
using System.Runtime.CompilerServices;
+[assembly: System.Runtime.InteropServices.ComVisible(false)]
+
// expose internal types to System.Design for type forwarding
[assembly: InternalsVisibleTo("System.Design, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListCollection.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListCollection.cs
index ba70d2e0d3b..aa6f1f1b0a1 100644
--- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListCollection.cs
+++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListCollection.cs
@@ -7,7 +7,6 @@
namespace System.ComponentModel.Design
{
- [ComVisible(true)]
public class DesignerActionListCollection : CollectionBase
{
public DesignerActionListCollection()
diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs
index 6af2d910938..49781241aad 100644
--- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs
+++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs
@@ -9,6 +9,5 @@ namespace System.ComponentModel.Design
///
/// This event is raised by the when a shortcut is either added or removed to/from the related object.
///
- [ComVisible(true)]
public delegate void DesignerActionListsChangedEventHandler(object sender, DesignerActionListsChangedEventArgs e);
}
diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedType.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedType.cs
index 350dc615dde..0ee53543712 100644
--- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedType.cs
+++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedType.cs
@@ -9,7 +9,6 @@ namespace System.ComponentModel.Design
///
/// An enum that defines what type of action happend to the related object's designer action lists collection.
///
- [ComVisible(true)]
public enum DesignerActionListsChangedType
{
///
diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventArgs.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventArgs.cs
index 27cef65009f..dcbc8379e51 100644
--- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventArgs.cs
+++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventArgs.cs
@@ -9,7 +9,6 @@ namespace System.ComponentModel.Design
/// that there has been a change in MenuCommands (added or removed)
/// on the related object.
///
- [System.Runtime.InteropServices.ComVisible(true)]
public class MenuCommandsChangedEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventHandler.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventHandler.cs
index 2048a311434..25a5d5a8a28 100644
--- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventHandler.cs
+++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedEventHandler.cs
@@ -8,7 +8,6 @@ namespace System.ComponentModel.Design
/// This event is thown by the MenuCommandService when a shortcut
/// is either added or removed to/from the related object.
///
- [System.Runtime.InteropServices.ComVisible(true)]
public delegate void MenuCommandsChangedEventHandler(object sender, MenuCommandsChangedEventArgs e);
}
diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedType.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedType.cs
index 57bd8eb9ef6..6b5bc4c8990 100644
--- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedType.cs
+++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MenuCommandsChangedType.cs
@@ -8,7 +8,6 @@ namespace System.ComponentModel.Design
/// An enum that defines what time of action happend to the
/// related object's MenuCommands collection.
///
- [System.Runtime.InteropServices.ComVisible(true)]
public enum MenuCommandsChangedType
{
///
diff --git a/src/System.Windows.Forms.Design/src/System/Drawing/Design/ColorEditor.cs b/src/System.Windows.Forms.Design/src/System/Drawing/Design/ColorEditor.cs
index 8785e38e9cd..3929e36f74e 100644
--- a/src/System.Windows.Forms.Design/src/System/Drawing/Design/ColorEditor.cs
+++ b/src/System.Windows.Forms.Design/src/System/Drawing/Design/ColorEditor.cs
@@ -552,7 +552,6 @@ private void SetFocus(Point newFocus)
}
}
- [ComVisible(true)]
public class ColorPaletteAccessibleObject : ControlAccessibleObject
{
private readonly ColorCellAccessibleObject[] cells;
@@ -598,7 +597,6 @@ public override AccessibleObject HitTest(int x, int y)
return base.HitTest(x, y);
}
- [ComVisible(true)]
public class ColorCellAccessibleObject : AccessibleObject
{
private readonly Color color;
diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.cs
index 44ffad77c57..4be4123e7ff 100644
--- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.cs
+++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.cs
@@ -2358,7 +2358,6 @@ private int GetParentPointFromLparam(IntPtr lParam)
return PARAM.ToInt(pt.X, pt.Y);
}
- [ComVisible(true)]
public class ControlDesignerAccessibleObject : AccessibleObject
{
private readonly ControlDesigner _designer = null;
diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/DesignerOptions.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/DesignerOptions.cs
index 990a95c5588..ab4b11fc3c3 100644
--- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/DesignerOptions.cs
+++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/DesignerOptions.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms.Design
///
/// Provides access to get and set option values for a designer.
///
- [ComVisible(true)]
public class DesignerOptions
{
private const int MinGridSize = 2;
diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs
index fa555060115..073dbe00913 100644
--- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs
+++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs
@@ -7,7 +7,6 @@ namespace System.Windows.Forms.Design
///
/// Provides an interface for a designer to support Insitu editing for selected components.
///
- [Runtime.InteropServices.ComVisible(true)]
internal interface ISupportInSituService
{
///
diff --git a/src/System.Windows.Forms.Primitives/src/Properties/InternalsVisibleTo.cs b/src/System.Windows.Forms.Primitives/src/Properties/AssemblyInfo.cs
similarity index 97%
rename from src/System.Windows.Forms.Primitives/src/Properties/InternalsVisibleTo.cs
rename to src/System.Windows.Forms.Primitives/src/Properties/AssemblyInfo.cs
index 348b2ca8d03..b67f2eb1951 100644
--- a/src/System.Windows.Forms.Primitives/src/Properties/InternalsVisibleTo.cs
+++ b/src/System.Windows.Forms.Primitives/src/Properties/AssemblyInfo.cs
@@ -4,6 +4,8 @@
using System.Runtime.CompilerServices;
+[assembly: System.Runtime.InteropServices.ComVisible(false)]
+
[assembly: InternalsVisibleTo("System.Windows.Forms, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Design, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Design.Editors, PublicKey=00000000000000000400000000000000")]
diff --git a/src/System.Windows.Forms.Primitives/tests/UnitTests/Interop/Mocks/MockAxHost.cs b/src/System.Windows.Forms.Primitives/tests/UnitTests/Interop/Mocks/MockAxHost.cs
index d53644548e5..6f168731b2a 100644
--- a/src/System.Windows.Forms.Primitives/tests/UnitTests/Interop/Mocks/MockAxHost.cs
+++ b/src/System.Windows.Forms.Primitives/tests/UnitTests/Interop/Mocks/MockAxHost.cs
@@ -10,8 +10,6 @@
namespace System.Windows.Forms.Primitives.Tests.Interop.Mocks
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
internal class MockAxHost
{
private static Guid ipictureDisp_Guid = typeof(IPictureDisp).GUID;
diff --git a/src/System.Windows.Forms/src/Properties/InternalsVisibleTo.cs b/src/System.Windows.Forms/src/Properties/AssemblyInfo.cs
similarity index 93%
rename from src/System.Windows.Forms/src/Properties/InternalsVisibleTo.cs
rename to src/System.Windows.Forms/src/Properties/AssemblyInfo.cs
index 0cd9da4ab7f..be6a8a6a34f 100644
--- a/src/System.Windows.Forms/src/Properties/InternalsVisibleTo.cs
+++ b/src/System.Windows.Forms/src/Properties/AssemblyInfo.cs
@@ -4,6 +4,8 @@
using System.Runtime.CompilerServices;
+[assembly: System.Runtime.InteropServices.ComVisible(false)]
+
[assembly: InternalsVisibleTo("System.Windows.Forms.Tests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("MauiMonthCalendarTests, PublicKey=00000000000000000400000000000000")]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
index 08dacaf0516..9616fb09b21 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
@@ -18,7 +18,6 @@ namespace System.Windows.Forms
/// Provides an implementation for an object that can be inspected by an
/// accessibility application.
///
- [ComVisible(true)]
public partial class AccessibleObject :
StandardOleMarshalObject,
IReflect,
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Appearance.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Appearance.cs
index ac66fd7776c..457270e0388 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Appearance.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Appearance.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies the appearance of a control.
///
- [ComVisible(true)]
public enum Appearance
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ArrangeDirection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ArrangeDirection.cs
index 5e97aff7754..068a2dd9bc1 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ArrangeDirection.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ArrangeDirection.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
///
/// Specifies the direction the system uses to arrange minimized windows.
///
- [ComVisible(true)]
[Flags]
public enum ArrangeDirection
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.AxComponentEditor.cs b/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.AxComponentEditor.cs
index 2edd449db5a..f113a901044 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.AxComponentEditor.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.AxComponentEditor.cs
@@ -14,7 +14,6 @@ namespace System.Windows.Forms
{
public abstract partial class AxHost
{
- [ComVisible(false)]
public class AxComponentEditor : WindowsFormsComponentEditor
{
public override bool EditComponent(ITypeDescriptorContext context, object obj, IWin32Window parent)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.cs b/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.cs
index 8dd9896bf0e..3f31dce8be9 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.cs
@@ -28,8 +28,6 @@ namespace System.Windows.Forms
///
/// Wraps ActiveX controls and exposes them as fully featured windows forms controls.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[ToolboxItem(false)]
[DesignTimeVisible(false)]
[DefaultEvent(nameof(Enter))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/BindingNavigator.cs b/src/System.Windows.Forms/src/System/Windows/Forms/BindingNavigator.cs
index 9502c8c615f..b7e176819a7 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/BindingNavigator.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/BindingNavigator.cs
@@ -11,8 +11,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(BindingSource))]
[DefaultEvent(nameof(RefreshItems))]
[Designer("System.Windows.Forms.Design.BindingNavigatorDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Border3DSide.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Border3DSide.cs
index 48361fc0fcf..caeb0dfb1e7 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Border3DSide.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Border3DSide.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
///
/// Specifies the sides of a rectangle to apply a three-dimensional border to.
///
- [ComVisible(true)]
[Flags]
public enum Border3DSide
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Border3DStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Border3DStyle.cs
index ac67f32f0bd..4c7e6c6f5da 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Border3DStyle.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Border3DStyle.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
///
/// Specifies the style of a three-dimensional border.
///
- [ComVisible(true)]
public enum Border3DStyle
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/BorderStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/BorderStyle.cs
index a327bbde54b..19b64f3eeda 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/BorderStyle.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/BorderStyle.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies the border style for a control or form.
///
- [ComVisible(true)]
public enum BorderStyle
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Button.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Button.cs
index 0b5bec260f1..afcb5ebb156 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Button.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Button.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
/// Represents a
/// Windows button.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[SRDescription(nameof(SR.DescriptionButton))]
[Designer("System.Windows.Forms.Design.ButtonBaseDesigner, " + AssemblyRef.SystemDesign)]
public class Button : ButtonBase, IButtonControl
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.cs
index b347398e74b..81c6acacac8 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
///
/// Implements the basic functionality required by a button control.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.ButtonBaseDesigner, " + AssemblyRef.SystemDesign)]
public abstract class ButtonBase : Control
{
@@ -1352,7 +1350,6 @@ protected override void WndProc(ref Message m)
}
}
- [ComVisible(true)]
public class ButtonBaseAccessibleObject : ControlAccessibleObject
{
public ButtonBaseAccessibleObject(Control owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.cs
index d930a0888da..acd660cbac3 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
/// Represents a Windows
/// check box.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Checked))]
[DefaultEvent(nameof(CheckedChanged))]
[DefaultBindingProperty(nameof(CheckState))]
@@ -648,7 +646,6 @@ public override string ToString()
return s + ", CheckState: " + checkState.ToString(CultureInfo.InvariantCulture);
}
- [ComVisible(true)]
public class CheckBoxAccessibleObject : ButtonBaseAccessibleObject
{
public CheckBoxAccessibleObject(Control owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/CheckedListBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/CheckedListBox.cs
index 33fc6e955aa..a797253b266 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/CheckedListBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/CheckedListBox.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
///
/// of each item.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[LookupBindingProperties]
[SRDescription(nameof(SR.DescriptionCheckedListBox))]
public class CheckedListBox : ListBox
@@ -1466,7 +1464,6 @@ internal void SetCheckedState(int index, CheckState value)
internal override bool SupportsUiaProviders => false;
- [ComVisible(true)]
internal class CheckedListBoxAccessibleObject : ControlAccessibleObject
{
///
@@ -1567,7 +1564,6 @@ public override AccessibleObject Navigate(AccessibleNavigation direction)
}
}
- [ComVisible(true)]
internal class CheckedListBoxItemAccessibleObject : AccessibleObject
{
private string name;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs
index 00243561885..741d95c6bde 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs
@@ -27,8 +27,6 @@ namespace System.Windows.Forms
/// list or to enter new text. Displays only the editing field until the user
/// explicitly displays the list.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(SelectedIndexChanged))]
[DefaultProperty(nameof(Items))]
[DefaultBindingProperty(nameof(Text))]
@@ -3943,7 +3941,6 @@ protected override void WndProc(ref Message m)
}
}
- [ComVisible(true)]
private class ComboBoxChildNativeWindow : NativeWindow
{
private readonly ComboBox _owner;
@@ -4535,7 +4532,6 @@ internal void SetItemInternal(int index, object value)
}
} // end ObjectCollection
- [ComVisible(true)]
public class ChildAccessibleObject : AccessibleObject
{
readonly ComboBox owner;
@@ -4560,7 +4556,6 @@ public override string Name
///
/// Represents the ComboBox item accessible object.
///
- [ComVisible(true)]
internal class ComboBoxItemAccessibleObject : AccessibleObject
{
private readonly ComboBox _owningComboBox;
@@ -4876,7 +4871,6 @@ public int GetId(object item)
/// This inherits from the base ComboBoxExAccessibleObject and ComboBoxAccessibleObject
/// to have all base functionality.
///
- [ComVisible(true)]
internal class ComboBoxAccessibleObject : ControlAccessibleObject
{
private const int COMBOBOX_ACC_ITEM_INDEX = 1;
@@ -5342,7 +5336,6 @@ internal override int[] RuntimeId
///
/// Represents the ComboBox's child (inner) list native window control accessible object with UI Automation provider functionality.
///
- [ComVisible(true)]
internal class ComboBoxChildListUiaProvider : ChildAccessibleObject
{
private const string COMBO_BOX_LIST_AUTOMATION_ID = "1000";
@@ -5584,7 +5577,6 @@ public override AccessibleStates State
///
/// Represents the ComboBox's child text (is used instead of inner Edit when style is DropDownList but not DropDown) accessible object.
///
- [ComVisible(true)]
internal class ComboBoxChildTextUiaProvider : AccessibleObject
{
private const int COMBOBOX_TEXT_ACC_ITEM_INDEX = 1;
@@ -5759,7 +5751,6 @@ public override AccessibleStates State
///
/// Represents the ComboBox child (inner) DropDown button accessible object with UI Automation functionality.
///
- [ComVisible(true)]
internal class ComboBoxChildDropDownButtonUiaProvider : AccessibleObject
{
private const int COMBOBOX_DROPDOWN_BUTTON_ACC_ITEM_INDEX = 2;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ContainerControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ContainerControl.cs
index 6980b965546..c31c7a59e70 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ContainerControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ContainerControl.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
///
/// Defines a base class for controls that can parent other controls.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class ContainerControl : ScrollableControl, IContainerControl
{
private Control _activeControl;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs
index dcd80b70bcc..8a1074e3f89 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs
@@ -13,8 +13,6 @@ namespace System.Windows.Forms
///
/// This class is just a conceptual wrapper around ToolStripDropDownMenu.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(Opening))]
[SRDescription(nameof(SR.DescriptionContextMenuStrip))]
public class ContextMenuStrip : ToolStripDropDownMenu
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlAccessibleObject.cs
index 2f482fe4367..49b53951aa1 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlAccessibleObject.cs
@@ -16,7 +16,6 @@ public partial class Control
///
/// An implementation of AccessibleChild for use with Controls
///
- [ComVisible(true)]
public class ControlAccessibleObject : AccessibleObject
{
private static IntPtr s_oleAccAvailable = NativeMethods.InvalidIntPtr;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlCollection.cs
index 694bc74d4a2..271f5bad4df 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlCollection.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlCollection.cs
@@ -18,7 +18,7 @@ public partial class Control
///
/// Collection of controls...
///
- [ListBindable(false), ComVisible(false)]
+ [ListBindable(false)]
public class ControlCollection : ArrangedElementCollection, IList, ICloneable
{
/// A caching mechanism for key accessor
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs
index 581fae29de5..bffc774e470 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs
@@ -35,8 +35,6 @@ namespace System.Windows.Forms
/// Do not add instance variables to Control absolutely necessary. Every control on a form has the overhead of
/// all of these variables.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Text))]
[DefaultEvent(nameof(Click))]
[Designer("System.Windows.Forms.Design.ControlDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.AccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.AccessibleObject.cs
index fcc6995a3ef..83123db5ad0 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.AccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.AccessibleObject.cs
@@ -12,7 +12,6 @@ namespace System.Windows.Forms
{
public partial class DataGridView
{
- [ComVisible(true)]
protected class DataGridViewAccessibleObject : ControlAccessibleObject
{
private int[] runtimeId = null; // Used by UIAutomation
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.ControlCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.ControlCollection.cs
index 2136da8f5e5..315fa605b50 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.ControlCollection.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.ControlCollection.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
{
public partial class DataGridView
{
- [ComVisible(false)]
public class DataGridViewControlCollection : ControlCollection
{
readonly DataGridView owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.TopRowAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.TopRowAccessibleObject.cs
index b8c6601e954..979a03e86d5 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.TopRowAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.TopRowAccessibleObject.cs
@@ -13,7 +13,6 @@ namespace System.Windows.Forms
{
public partial class DataGridView
{
- [ComVisible(true)]
protected class DataGridViewTopRowAccessibleObject : AccessibleObject
{
private int[] runtimeId;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.cs
index fbca961b288..cfcd38d2d1d 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.cs
@@ -14,8 +14,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.DataGridViewDesigner, " + AssemblyRef.SystemDesign)]
[DefaultEvent(nameof(CellContentClick))]
[ComplexBindingProperties(nameof(DataSource), nameof(DataMember))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCell.DataGridViewCellAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCell.DataGridViewCellAccessibleObject.cs
index 694c09303d9..16247e6316b 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCell.DataGridViewCellAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCell.DataGridViewCellAccessibleObject.cs
@@ -14,7 +14,6 @@ namespace System.Windows.Forms
{
public abstract partial class DataGridViewCell
{
- [ComVisible(true)]
protected class DataGridViewCellAccessibleObject : AccessibleObject
{
private int[] runtimeId = null; // Used by UIAutomation
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs
index 17ba7c51409..fc9d1aee081 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs
@@ -11,8 +11,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class DataGridViewComboBoxEditingControl : ComboBox, IDataGridViewEditingControl
{
private DataGridView dataGridView;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewElementStates.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewElementStates.cs
index 2fbc61de865..12acd42ea87 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewElementStates.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewElementStates.cs
@@ -7,7 +7,6 @@
namespace System.Windows.Forms
{
[Flags]
- [ComVisible(true)]
public enum DataGridViewElementStates
{
None = 0x0000,
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewRow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewRow.cs
index a197579f5db..6c541f0b10a 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewRow.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewRow.cs
@@ -1770,7 +1770,6 @@ public override string ToString()
return sb.ToString();
}
- [ComVisible(true)]
protected class DataGridViewRowAccessibleObject : AccessibleObject
{
private int[] runtimeId;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs
index 8adc20891d6..3e34a360465 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs
@@ -10,8 +10,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class DataGridViewTextBoxEditingControl : TextBox, IDataGridViewEditingControl
{
private static readonly DataGridViewContentAlignment anyTop = DataGridViewContentAlignment.TopLeft | DataGridViewContentAlignment.TopCenter | DataGridViewContentAlignment.TopRight;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DateTimePicker.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DateTimePicker.cs
index 31282c104ba..cc7e8b67cbd 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DateTimePicker.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DateTimePicker.cs
@@ -19,8 +19,6 @@ namespace System.Windows.Forms
///
/// Date/DateTime picker control
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Value))]
[DefaultEvent(nameof(ValueChanged))]
[DefaultBindingProperty(nameof(Value))]
@@ -1687,7 +1685,6 @@ public BOOL enumChildren(IntPtr hwnd)
}
}
- [ComVisible(true)]
public class DateTimePickerAccessibleObject : ControlAccessibleObject
{
public DateTimePickerAccessibleObject(DateTimePicker owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorForm.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorForm.cs
index 52c021db29e..0cd183f96db 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorForm.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorForm.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms.Design
///
/// Provides a user interface for .
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[ToolboxItem(false)]
public class ComponentEditorForm : Form
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorPage.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorPage.cs
index 79783640952..c357cf8d38c 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorPage.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Design/ComponentEditorPage.cs
@@ -15,8 +15,6 @@ namespace System.Windows.Forms.Design
///
/// Provides a base implementation for a .
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public abstract class ComponentEditorPage : Panel
{
private Icon _icon;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DialogResult.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DialogResult.cs
index 0a99ff0307f..7c2a7ac6eb1 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DialogResult.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DialogResult.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies identifiers to indicate the return value of a dialog box.
///
- [ComVisible(true)]
public enum DialogResult
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DomainUpDown.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DomainUpDown.cs
index 470650a8fc9..36ffb3f47d4 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DomainUpDown.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DomainUpDown.cs
@@ -19,8 +19,6 @@ namespace System.Windows.Forms
///
/// Represents a Windows up-down control that displays string values.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Items))]
[DefaultEvent(nameof(SelectedItemChanged))]
[DefaultBindingProperty(nameof(SelectedItem))]
@@ -688,7 +686,6 @@ public int Compare(object p, object q)
}
}
- [ComVisible(true)]
public class DomainUpDownAccessibleObject : ControlAccessibleObject
{
private DomainItemListAccessibleObject itemList;
@@ -872,7 +869,6 @@ public override int GetChildCount()
}
}
- [ComVisible(true)]
public class DomainItemAccessibleObject : AccessibleObject
{
private string name;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DragAction.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DragAction.cs
index 329959e299d..77cf51b1e94 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DragAction.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DragAction.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies how and if a drag-and-drop operation should continue.
///
- [ComVisible(true)]
public enum DragAction
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DragEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DragEventArgs.cs
index cc0ccdd32c9..4ad408038e0 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/DragEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/DragEventArgs.cs
@@ -12,7 +12,6 @@ namespace System.Windows.Forms
/// Provides data for the , ,
/// or event.
///
- [ComVisible(true)]
public class DragEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/FlowLayoutPanel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/FlowLayoutPanel.cs
index a62b2b86529..e957a4f18ce 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/FlowLayoutPanel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/FlowLayoutPanel.cs
@@ -11,8 +11,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[ProvideProperty("FlowBreak", typeof(Control))]
[DefaultProperty(nameof(FlowDirection))]
[Designer("System.Windows.Forms.Design.FlowLayoutPanelDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs
index 1ff7f4d502f..f8041853884 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
///
/// Represents a window or dialog box that makes up an application's user interface.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[ToolboxItemFilter("System.Windows.Forms.Control.TopLevel")]
[ToolboxItem(false)]
[DesignTimeVisible(false)]
@@ -6539,7 +6537,6 @@ protected override void WndProc(ref Message m)
///
/// Represents a collection of controls on the form.
///
- [ComVisible(false)]
public new class ControlCollection : Control.ControlCollection
{
private readonly Form owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/FormBorderStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/FormBorderStyle.cs
index 106a36fe13b..a1d19d5de5f 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/FormBorderStyle.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/FormBorderStyle.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies the border styles for a form.
///
- [ComVisible(true)]
public enum FormBorderStyle
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/FormStartPosition.cs b/src/System.Windows.Forms/src/System/Windows/Forms/FormStartPosition.cs
index f62d6749b1c..1b34d8ec482 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/FormStartPosition.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/FormStartPosition.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies the initial position of a form.
///
- [ComVisible(true)]
public enum FormStartPosition
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/FormWindowState.cs b/src/System.Windows.Forms/src/System/Windows/Forms/FormWindowState.cs
index 08a24ed8492..310a94ba44a 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/FormWindowState.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/FormWindowState.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies how a form window is displayed.
///
- [ComVisible(true)]
public enum FormWindowState
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/GiveFeedbackEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/GiveFeedbackEventArgs.cs
index c97c9224c36..a3729d904f7 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/GiveFeedbackEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/GiveFeedbackEventArgs.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class GiveFeedbackEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.GroupBoxAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.GroupBoxAccessibleObject.cs
index a31a9bcb6dd..a6d69e006cc 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.GroupBoxAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.GroupBoxAccessibleObject.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
{
public partial class GroupBox
{
- [ComVisible(true)]
internal class GroupBoxAccessibleObject : ControlAccessibleObject
{
internal GroupBoxAccessibleObject(GroupBox owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.cs
index 472d840af33..15235b4fbd0 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/GroupBox.cs
@@ -19,8 +19,6 @@ namespace System.Windows.Forms
/// a standard Windows(r) group
/// box.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(Enter))]
[DefaultProperty(nameof(Text))]
[Designer("System.Windows.Forms.Design.GroupBoxDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/HScrollBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/HScrollBar.cs
index 852449f7030..7d7b4383f44 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/HScrollBar.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/HScrollBar.cs
@@ -11,8 +11,6 @@ namespace System.Windows.Forms
///
/// Represents a standard Windows horizontal scroll bar.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[SRDescription(nameof(SR.DescriptionHScrollBar))]
public class HScrollBar : ScrollBar
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/HelpEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/HelpEventArgs.cs
index 21bbbe8577f..efbdf13b102 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/HelpEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/HelpEventArgs.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
///
/// Provides data for the Control.HelpRequest event.
///
- [ComVisible(true)]
public class HelpEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/HorizontalAlignment.cs b/src/System.Windows.Forms/src/System/Windows/Forms/HorizontalAlignment.cs
index 7df25198964..196b0d381d2 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/HorizontalAlignment.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/HorizontalAlignment.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
/// Specifies how an object or text in a control is horizontally aligned
/// relative to an element of the control.
///
- [ComVisible(true)]
public enum HorizontalAlignment
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/IDataObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/IDataObject.cs
index bd1891a8e71..717ceb328c2 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/IDataObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/IDataObject.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
///
/// Provides a format-independent mechanism for transferring data.
///
- [ComVisible(true)]
public interface IDataObject
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/IMEMode.cs b/src/System.Windows.Forms/src/System/Windows/Forms/IMEMode.cs
index 73d92677e1b..bf6d8fdf10a 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/IMEMode.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/IMEMode.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
/// Specifies a value that determines the IME (Input Method Editor) status
/// of the object when that object is selected.
///
- [ComVisible(true)]
public enum ImeMode
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/IWin32window.cs b/src/System.Windows.Forms/src/System/Windows/Forms/IWin32window.cs
index 248436aa82e..0716380f8fa 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/IWin32window.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/IWin32window.cs
@@ -6,9 +6,8 @@
namespace System.Windows.Forms
{
- [Guid("458AB8A2-A1EA-4d7b-8EBE-DEE5D3D9442C")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- [ComVisible(true)]
+ // Desktop Framework uses GUID 458AB8A2-A1EA-4d7b-8EBE-DEE5D3D9442C
+ // If interop with Desktop Framework is required this can be ComImported.
public interface IWin32Window
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ItemCheckEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ItemCheckEventArgs.cs
index 2cdeb8eeb34..0697c7751a7 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ItemCheckEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ItemCheckEventArgs.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class ItemCheckEventArgs : EventArgs
{
public ItemCheckEventArgs(int index, CheckState newCheckValue, CheckState currentValue)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ItemDragEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ItemDragEventArgs.cs
index e84aa210ff4..5da7864ce2e 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ItemDragEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ItemDragEventArgs.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class ItemDragEventArgs : EventArgs
{
public ItemDragEventArgs(MouseButtons button) : this(button, null)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/KeyEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/KeyEventArgs.cs
index b8cbc4f38d8..6455491aed4 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/KeyEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/KeyEventArgs.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
/// Provides data for the or
/// event.
///
- [ComVisible(true)]
public class KeyEventArgs : EventArgs
{
private bool _suppressKeyPress = false;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/KeyPressEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/KeyPressEventArgs.cs
index cebd7d43d70..ec1a5feb830 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/KeyPressEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/KeyPressEventArgs.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class KeyPressEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Keys.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Keys.cs
index 186ebf479e2..4d546574470 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Keys.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Keys.cs
@@ -16,7 +16,6 @@ namespace System.Windows.Forms
[Flags]
[TypeConverter(typeof(KeysConverter))]
[Editor("System.Windows.Forms.Design.ShortcutKeysEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor))]
- [ComVisible(true)]
public enum Keys
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Label.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Label.cs
index e2b1d471d19..9f919689a7b 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Label.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Label.cs
@@ -20,8 +20,6 @@ namespace System.Windows.Forms
///
/// Represents a standard Windows label.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Text))]
[DefaultBindingProperty(nameof(Text))]
[Designer("System.Windows.Forms.Design.LabelDesigner, " + AssemblyRef.SystemDesign)]
@@ -1649,7 +1647,6 @@ protected override void WndProc(ref Message m)
}
}
- [ComVisible(true)]
internal class LabelAccessibleObject : ControlAccessibleObject
{
public LabelAccessibleObject(Label owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/LeftRightAlignment.cs b/src/System.Windows.Forms/src/System/Windows/Forms/LeftRightAlignment.cs
index cafdbb01cf6..a8f8a28b206 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/LeftRightAlignment.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/LeftRightAlignment.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
/// the left or
/// right of a reference point.
///
- [ComVisible(true)]
public enum LeftRightAlignment
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/LinkClickedEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/LinkClickedEventArgs.cs
index 47f73121a21..0c0ca812b50 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/LinkClickedEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/LinkClickedEventArgs.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class LinkClickedEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabel.cs
index c170a7b12fe..f03e2adcf47 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabel.cs
@@ -20,8 +20,6 @@ namespace System.Windows.Forms
///
/// Displays text that can contain a hyperlink.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(LinkClicked))]
[ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem," + AssemblyRef.SystemDesign)]
[SRDescription(nameof(SR.DescriptionLinkLabel))]
@@ -2644,7 +2642,6 @@ int IComparer.Compare(object link1, object link2)
}
}
- [ComVisible(true)]
internal class LinkLabelAccessibleObject : LabelAccessibleObject
{
///
@@ -2705,7 +2702,6 @@ public override int GetChildCount()
}
}
- [ComVisible(true)]
internal class LinkAccessibleObject : AccessibleObject
{
private readonly Link link;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabelLinkClickedEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabelLinkClickedEventArgs.cs
index 9006b339935..1166d0c6ee5 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabelLinkClickedEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/LinkLabelLinkClickedEventArgs.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class LinkLabelLinkClickedEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.AccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.AccessibleObject.cs
index a8a51c17f8d..a1e65452132 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.AccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.AccessibleObject.cs
@@ -19,7 +19,6 @@ public partial class ListBox
/// This inherits from the base ListBoxExAccessibleObject and ListBoxAccessibleObject
/// to have all base functionality.
///
- [ComVisible(true)]
internal class ListBoxAccessibleObject : ControlAccessibleObject
{
private readonly Dictionary _itemAccessibleObjects;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.ItemAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.ItemAccessibleObject.cs
index d843d329586..69c1cd5a550 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.ItemAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.ItemAccessibleObject.cs
@@ -18,7 +18,6 @@ public partial class ListBox
/// This inherits from the base ListBoxExAccessibleObject and ListBoxAccessibleObject
/// to have all base functionality.
///
- [ComVisible(true)]
internal class ListBoxItemAccessibleObject : AccessibleObject
{
private readonly ItemArray.Entry _itemEntry;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs
index cb5e026b4b1..0d65e702b7b 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs
@@ -38,8 +38,6 @@ namespace System.Windows.Forms
/// "D" };
///
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.ListBoxDesigner, " + AssemblyRef.SystemDesign)]
[DefaultEvent(nameof(SelectedIndexChanged))]
[DefaultProperty(nameof(Items))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListControl.cs
index a2e4aea49bb..c1d0916ad55 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ListControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListControl.cs
@@ -13,8 +13,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[LookupBindingProperties(nameof(ListControl.DataSource), nameof(ListControl.DisplayMember), nameof(ListControl.ValueMember), nameof(ListControl.SelectedValue))]
public abstract class ListControl : Control
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs
index 30dc71609c3..826720ac4c1 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs
@@ -24,8 +24,6 @@ namespace System.Windows.Forms
/// Displays a list of items in one of four
/// views. Each item displays a caption and optionally an image.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Docking(DockingBehavior.Ask)]
[Designer("System.Windows.Forms.Design.ListViewDesigner, " + AssemblyRef.SystemDesign)]
[DefaultProperty(nameof(Items))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListViewItemMouseHoverEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListViewItemMouseHoverEventArgs.cs
index 4e66aa7a1dd..4bfba5a1fd6 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ListViewItemMouseHoverEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListViewItemMouseHoverEventArgs.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class ListViewItemMouseHoverEventArgs : EventArgs
{
public ListViewItemMouseHoverEventArgs(ListViewItem item)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MDIClient.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MDIClient.cs
index dbe61134fa7..b6b09b8a2ed 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/MDIClient.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/MDIClient.cs
@@ -20,8 +20,6 @@ namespace System.Windows.Forms
/// Don't create an control.
/// A form creates and uses the when you set the property to .
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[ToolboxItem(false)]
[DesignTimeVisible(false)]
public sealed class MdiClient : Control
@@ -420,7 +418,6 @@ private void OnIdle(object sender, EventArgs e)
///
/// Collection of controls...
///
- [ComVisible(false)]
new public class ControlCollection : Control.ControlCollection
{
private readonly MdiClient owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.cs
index 1443616a695..28457edd1e4 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
/// Uses the services from the System.ComponentModel.MaskedTextBoxProvider class.
/// See spec at http://dotnetclient/whidbey/Specs/MaskEdit.doc
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(MaskInputRejected))]
[DefaultBindingProperty(nameof(Text))]
[DefaultProperty(nameof(Mask))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MenuStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MenuStrip.cs
index 874aff71c28..aff36c6354b 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/MenuStrip.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/MenuStrip.cs
@@ -12,10 +12,7 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [SRDescription(nameof(SR.DescriptionMenuStrip))
- ]
+ [SRDescription(nameof(SR.DescriptionMenuStrip))]
public class MenuStrip : ToolStrip
{
private ToolStripMenuItem mdiWindowListItem = null;
@@ -263,7 +260,6 @@ protected override void WndProc(ref Message m)
base.WndProc(ref m);
}
- [ComVisible(true)]
internal class MenuStripAccessibleObject : ToolStripAccessibleObject
{
public MenuStripAccessibleObject(MenuStrip owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
index cc3a544b161..3894082dfcb 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.MonthCalendarAccessibleObject.cs
@@ -14,7 +14,6 @@ namespace System.Windows.Forms
{
public partial class MonthCalendar
{
- [ComVisible(true)]
internal class MonthCalendarAccessibleObject : ControlAccessibleObject
{
internal const int MAX_DAYS = 7;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
index b355340fe0f..589c82ca732 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs
@@ -56,8 +56,6 @@ namespace System.Windows.Forms
///
/// The same applies to addition and removal of annual and monthly bolded dates.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(SelectionRange))]
[DefaultEvent(nameof(DateChanged))]
[DefaultBindingProperty(nameof(SelectionRange))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MouseButtons.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MouseButtons.cs
index c512d89760f..df6462968a4 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/MouseButtons.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/MouseButtons.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
/// Specifies constants that define which mouse button was pressed.
///
[Flags]
- [ComVisible(true)]
public enum MouseButtons
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MouseEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MouseEventArgs.cs
index e9bbabe20bd..879ad2d2fdf 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/MouseEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/MouseEventArgs.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
/// Provides data for the , and
/// events.
///
- [ComVisible(true)]
public class MouseEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/NavigateEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/NavigateEventArgs.cs
index 72b3684af6d..2e11a8b2cfa 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/NavigateEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/NavigateEventArgs.cs
@@ -6,7 +6,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
public class NavigateEventArgs : EventArgs
{
public NavigateEventArgs(bool isForward)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/NumericUpDown.cs b/src/System.Windows.Forms/src/System/Windows/Forms/NumericUpDown.cs
index 4070f363f3b..a53d02fa5b5 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/NumericUpDown.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/NumericUpDown.cs
@@ -16,8 +16,6 @@ namespace System.Windows.Forms
///
/// Represents a Windows up-down control that displays numeric values.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Value))]
[DefaultEvent(nameof(ValueChanged))]
[DefaultBindingProperty(nameof(Value))]
@@ -889,7 +887,6 @@ private int GetLargestDigit(int start, int end)
return largestDigit;
}
- [ComVisible(true)]
internal class NumericUpDownAccessibleObject : ControlAccessibleObject
{
private readonly UpDownBase _owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Panel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Panel.cs
index 6bb7d0b48b0..4b3983f3649 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Panel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Panel.cs
@@ -15,8 +15,6 @@ namespace System.Windows.Forms
///
/// Represents a control.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(BorderStyle))]
[DefaultEvent(nameof(Paint))]
[Docking(DockingBehavior.Ask)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
index 7a5725da9fb..a4159bc1122 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
/// Displays an image that can be a graphic from a bitmap, icon, or metafile, as well as from
/// an enhanced metafile, JPEG, or GIF files.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Image))]
[DefaultBindingProperty(nameof(Image))]
[Docking(DockingBehavior.Ask)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewControl.cs
index 5cb6a395ea7..226f00c5c5d 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewControl.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
/// Most PrintPreviewControl's are found on PrintPreviewDialog's,
/// but they don't have to be.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Document))]
[SRDescription(nameof(SR.DescriptionPrintPreviewControl))]
public class PrintPreviewControl : Control
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewDialog.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewDialog.cs
index db3c3308689..a7bba4886c5 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewDialog.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Printing/PrintPreviewDialog.cs
@@ -15,8 +15,6 @@ namespace System.Windows.Forms
/// Represents a
/// dialog box form that contains a .
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.ComponentModel.Design.ComponentDesigner, " + AssemblyRef.SystemDesign)]
[DesignTimeVisible(true)]
[DefaultProperty(nameof(Document))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ProgressBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ProgressBar.cs
index 83c29518e27..e1d20919702 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ProgressBar.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ProgressBar.cs
@@ -16,8 +16,6 @@ namespace System.Windows.Forms
///
/// Represents a Windows progress bar control.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Value))]
[DefaultBindingProperty(nameof(Value))]
[SRDescription(nameof(SR.DescriptionProgressBar))]
@@ -709,7 +707,6 @@ private void UserPreferenceChangedHandler(object o, UserPreferenceChangedEventAr
protected override AccessibleObject CreateAccessibilityInstance()
=> new ProgressBarAccessibleObject(this);
- [ComVisible(true)]
internal class ProgressBarAccessibleObject : ControlAccessibleObject
{
internal ProgressBarAccessibleObject(ProgressBar owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs
index fc453d2b18b..d52d6aac926 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs
@@ -23,8 +23,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.PropertyGridDesigner, " + AssemblyRef.SystemDesign)]
[SRDescription(nameof(SR.DescriptionPropertyGrid))]
public class PropertyGrid : ContainerControl, IComPropertyBrowser, Ole32.IPropertyNotifySink
@@ -5508,7 +5506,6 @@ private static string GenerateLogFileName(ref IntPtr fileId)
/// Represents the PropertyGrid accessibility object.
/// Is used only in Accessibility Improvements of level3 to show correct accessible hierarchy.
///
- [ComVisible(true)]
internal class PropertyGridAccessibleObject : Control.ControlAccessibleObject
{
private readonly PropertyGrid _owningPropertyGrid;
@@ -5795,7 +5792,6 @@ protected override AccessibleObject CreateAccessibilityInstance()
///
/// Represents the PropertyGridToolStrip control accessibility object.
///
- [ComVisible(true)]
internal class PropertyGridToolStripAccessibleObject : ToolStrip.ToolStripAccessibleObject
{
private readonly PropertyGrid _parentPropertyGrid;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/CategoryGridEntry.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/CategoryGridEntry.cs
index 27082c28526..2c7c09e7f59 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/CategoryGridEntry.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/CategoryGridEntry.cs
@@ -271,7 +271,6 @@ internal override bool NotifyChildValue(GridEntry pe, int type)
///
/// Defines the Category Grid Entry accessible object that is derived from Grid Entry accessible object.
///
- [Runtime.InteropServices.ComVisible(true)]
internal class CategoryGridEntryAccessibleObject : GridEntryAccessibleObject
{
private readonly CategoryGridEntry _owningCategoryGridEntry;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DocComment.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DocComment.cs
index 6829df34814..2c01e8bc3d0 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DocComment.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DocComment.cs
@@ -258,7 +258,6 @@ private void UpdateUIWithFont()
///
/// Represents the DocComment control accessible object.
///
- [Runtime.InteropServices.ComVisible(true)]
internal class DocCommentAccessibleObject : Control.ControlAccessibleObject
{
private readonly PropertyGrid _parentPropertyGrid;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DropDownButton.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DropDownButton.cs
index e3e9ecfa2c9..d6a2ef0d18a 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DropDownButton.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/DropDownButton.cs
@@ -239,7 +239,6 @@ internal override void DrawImageCore(Graphics graphics, Image image, Rectangle i
/// Represents the accessibility object for the PropertyGrid DropDown button.
/// This DropDownButtonAccessibleObject is available in Level3 only.
///
- [Runtime.InteropServices.ComVisible(true)]
internal class DropDownButtonAccessibleObject : Control.ControlAccessibleObject
{
private readonly DropDownButton _owningDropDownButton;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/GridEntry.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/GridEntry.cs
index ac09a7874f7..420b58b01ec 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/GridEntry.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/GridEntry.cs
@@ -3009,7 +3009,6 @@ internal EventEntry(EventEntry next, object key, Delegate handler)
}
}
- [ComVisible(true)]
public class GridEntryAccessibleObject : AccessibleObject
{
protected GridEntry owner = null;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/HotCommands.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/HotCommands.cs
index 04e3d40ba76..86298187c61 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/HotCommands.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/HotCommands.cs
@@ -253,7 +253,6 @@ private void SetupLabel()
///
/// Represents the hot commands control accessible object.
///
- [Runtime.InteropServices.ComVisible(true)]
internal class HotCommandsAccessibleObject : Control.ControlAccessibleObject
{
private readonly PropertyGrid _parentPropertyGrid;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyDescriptorGridEntry.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyDescriptorGridEntry.cs
index b244a17744b..c1d98ab1a66 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyDescriptorGridEntry.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyDescriptorGridEntry.cs
@@ -1122,7 +1122,6 @@ protected override GridEntryAccessibleObject GetAccessibilityObject()
return new PropertyDescriptorGridEntryAccessibleObject(this);
}
- [ComVisible(true)]
protected class PropertyDescriptorGridEntryAccessibleObject : GridEntryAccessibleObject
{
private readonly PropertyDescriptorGridEntry _owningPropertyDescriptorGridEntry;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyGridView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyGridView.cs
index 7b75b22fa20..c3b742d84f6 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyGridView.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/PropertyGridView.cs
@@ -6912,7 +6912,6 @@ protected override void OnSelectedIndexChanged(EventArgs e)
}
}
- [ComVisible(true)]
private class GridViewListBoxItemAccessibleObject : AccessibleObject
{
private readonly GridViewListBox _owningGridViewListBox;
@@ -7174,7 +7173,6 @@ public override object this[object key]
///
/// Represents the PropertyGridView ListBox accessibility object.
///
- [ComVisible(true)]
private class GridViewListBoxAccessibleObject : ControlAccessibleObject
{
private readonly GridViewListBox _owningGridViewListBox;
@@ -7724,7 +7722,6 @@ public virtual bool InSetText()
return fInSetText;
}
- [ComVisible(true)]
protected class GridViewEditAccessibleObject : ControlAccessibleObject
{
private readonly PropertyGridView propertyGridView;
@@ -8159,7 +8156,6 @@ public virtual IntPtr Callback(User32.HC nCode, IntPtr wparam, IntPtr lparam)
/// The accessible object class for a PropertyGridView. The child accessible objects
/// are accessible objects corresponding to the property grid entries.
///
- [ComVisible(true)]
internal class PropertyGridViewAccessibleObject : ControlAccessibleObject
{
private readonly PropertyGridView _owningPropertyGridView;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertySort.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertySort.cs
index 9ce47032f35..b7827f6922b 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertySort.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertySort.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Possible values for property grid sorting mode
///
- [ComVisible(true)]
public enum PropertySort
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyTabChangedEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyTabChangedEventArgs.cs
index 355336af0e9..a4912e999d4 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyTabChangedEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyTabChangedEventArgs.cs
@@ -9,7 +9,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
public class PropertyTabChangedEventArgs : EventArgs
{
public PropertyTabChangedEventArgs(PropertyTab oldTab, PropertyTab newTab)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyValueChangedEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyValueChangedEventArgs.cs
index 205b575f56c..aed57bb110d 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyValueChangedEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyValueChangedEventArgs.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
///
/// The event class that is created when a property in the grid is modified by the user.
///
- [ComVisible(true)]
public class PropertyValueChangedEventArgs : EventArgs
{
public PropertyValueChangedEventArgs(GridItem changedItem, object oldValue)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/QueryAccessibilityHelpEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/QueryAccessibilityHelpEventArgs.cs
index 21d697cb740..02254140fa8 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/QueryAccessibilityHelpEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/QueryAccessibilityHelpEventArgs.cs
@@ -12,7 +12,6 @@ namespace System.Windows.Forms
/// The QueryAccessibilityHelpEventArgs is fired when AccessibleObject is providing help
/// to accessibility applications.
///
- [ComVisible(true)]
public class QueryAccessibilityHelpEventArgs : EventArgs
{
public QueryAccessibilityHelpEventArgs()
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/QueryContinueDragEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/QueryContinueDragEventArgs.cs
index fdf43772fce..b5d31564877 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/QueryContinueDragEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/QueryContinueDragEventArgs.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class QueryContinueDragEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/RadioButton.cs b/src/System.Windows.Forms/src/System/Windows/Forms/RadioButton.cs
index a6249e42091..295f47c6816 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/RadioButton.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/RadioButton.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
/// standard
/// Windows radio button (option button).
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Checked))]
[DefaultEvent(nameof(CheckedChanged))]
[DefaultBindingProperty(nameof(Checked))]
@@ -603,7 +601,6 @@ public override string ToString()
return s + ", Checked: " + Checked.ToString();
}
- [ComVisible(true)]
public class RadioButtonAccessibleObject : ButtonBaseAccessibleObject
{
public RadioButtonAccessibleObject(RadioButton owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/RichTextBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/RichTextBox.cs
index 2eb11c42097..030c9df9be9 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/RichTextBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/RichTextBox.cs
@@ -23,8 +23,6 @@ namespace System.Windows.Forms
/// Rich Text control. The RichTextBox is a control that contains formatted text.
/// It supports font selection, boldface, and other type attributes.
///
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
[Docking(DockingBehavior.Ask)]
[Designer("System.Windows.Forms.Design.RichTextBoxDesigner, " + AssemblyRef.SystemDesign)]
[SRDescription(nameof(SR.DescriptionRichTextBox))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollBar.cs
index f0d99c45566..1f2a054e47f 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollBar.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollBar.cs
@@ -12,8 +12,6 @@ namespace System.Windows.Forms
///
/// Implements the basic functionality of a scroll bar control.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Value))]
[DefaultEvent(nameof(Scroll))]
public abstract class ScrollBar : Control
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventArgs.cs
index 97eb2774ecc..9929714044b 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventArgs.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
/// Provides data for the
/// event.
///
- [ComVisible(true)]
public class ScrollEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventType.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventType.cs
index c6bce8051b9..03562729d76 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventType.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollEventType.cs
@@ -10,7 +10,6 @@ namespace System.Windows.Forms
///
/// Specifies the type of action used to raise the event.
///
- [ComVisible(true)]
public enum ScrollEventType
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollableControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollableControl.cs
index b035a8738c9..84a9e09876c 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ScrollableControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ScrollableControl.cs
@@ -16,8 +16,6 @@ namespace System.Windows.Forms
///
/// Defines a base class for controls that support auto-scrolling behavior.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.ScrollableControlDesigner, " + AssemblyRef.SystemDesign)]
public class ScrollableControl : Control, IArrangedElement
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SelectionMode.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SelectionMode.cs
index 11af1e6c90c..7749cdb253e 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/SelectionMode.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/SelectionMode.cs
@@ -6,7 +6,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
public enum SelectionMode
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Shortcut.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Shortcut.cs
index 6cfe2fefbcc..97346cb33b4 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Shortcut.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Shortcut.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Specifies shortcut keys that can be used by menu items.
///
- [ComVisible(true)]
public enum Shortcut
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SplitContainer.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SplitContainer.cs
index 23ca8b28785..73b5f16a4fc 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/SplitContainer.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/SplitContainer.cs
@@ -21,8 +21,6 @@ namespace System.Windows.Forms
/// With this control the user need be aware of docking, z-order of the controls. The controls get parented when thry are
/// dropped on the SpitContainer.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(SplitterMoved))]
[Docking(DockingBehavior.AutoDock)]
[Designer("System.Windows.Forms.Design.SplitContainerDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Splitter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Splitter.cs
index 6238fe1230a..78ba3854453 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Splitter.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Splitter.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
/// edge. The splitter will then resize the control that is previous in the docking
/// order.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(SplitterMoved))]
[DefaultProperty(nameof(Dock))]
[SRDescription(nameof(SR.DescriptionSplitter))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SplitterEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SplitterEventArgs.cs
index 00595cb2393..5ee379606f7 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/SplitterEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/SplitterEventArgs.cs
@@ -9,7 +9,6 @@ namespace System.Windows.Forms
///
/// Provides data for splitter events.
///
- [ComVisible(true)]
public class SplitterEventArgs : EventArgs
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SplitterPanel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SplitterPanel.cs
index 70cfe22e0c8..ef849e24476 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/SplitterPanel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/SplitterPanel.cs
@@ -10,8 +10,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Docking(DockingBehavior.Never)]
[Designer("System.Windows.Forms.Design.SplitterPanelDesigner, " + AssemblyRef.SystemDesign)]
[ToolboxItem(false)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/StatusStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/StatusStrip.cs
index 8da336c4926..596cd396003 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/StatusStrip.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/StatusStrip.cs
@@ -13,10 +13,7 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [SRDescription(nameof(SR.DescriptionStatusStrip))
- ]
+ [SRDescription(nameof(SR.DescriptionStatusStrip))]
public class StatusStrip : ToolStrip
{
private const AnchorStyles AllAnchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top;
@@ -649,7 +646,6 @@ protected override void WndProc(ref Message m)
}
}
- [ComVisible(true)]
internal class StatusStripAccessibleObject : ToolStripAccessibleObject
{
public StatusStripAccessibleObject(StatusStrip owner) : base(owner)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SystemParameter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SystemParameter.cs
index 996f2b35857..1b2a4c925d3 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/SystemParameter.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/SystemParameter.cs
@@ -6,7 +6,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
public enum SystemParameter
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.ControlCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.ControlCollection.cs
index 4f2b7efd01d..8f1ecea0558 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.ControlCollection.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.ControlCollection.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
{
public partial class TabControl
{
- [ComVisible(false)]
public new class ControlCollection : Control.ControlCollection
{
private readonly TabControl _owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.cs
index f18190b9e6e..796147c723d 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
/// The TabControl. This control has a lot of the functionality of a TabStrip
/// but manages a list of TabPages which are the 'pages' that appear on each tab.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(TabPages))]
[DefaultEvent(nameof(SelectedIndexChanged))]
[Designer("System.Windows.Forms.Design.TabControlDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs
index 3830e963b05..b131f61f9e9 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs
@@ -17,8 +17,6 @@ namespace System.Windows.Forms
/// TabPage implements a single page of a tab control. It is essentially a Panel with TabItem
/// properties.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.TabPageDesigner, " + AssemblyRef.SystemDesign)]
[ToolboxItem(false)]
[DesignTimeVisible(false)]
@@ -564,7 +562,6 @@ internal void UpdateParent()
///
/// Our control collection will throw an exception if you try to add other tab pages.
///
- [ComVisible(false)]
public class TabPageControlCollection : ControlCollection
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TableLayoutPanel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TableLayoutPanel.cs
index 1b44ecb8a46..a03b8d99e1d 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TableLayoutPanel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TableLayoutPanel.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
[DesignerSerializer("System.Windows.Forms.Design.TableLayoutPanelCodeDomSerializer, " + AssemblyRef.SystemDesign, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + AssemblyRef.SystemDesign)]
[Docking(DockingBehavior.Never)]
[Designer("System.Windows.Forms.Design.TableLayoutPanelDesigner, " + AssemblyRef.SystemDesign)]
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[SRDescription(nameof(SR.DescriptionTableLayoutPanel))]
public class TableLayoutPanel : Panel, IExtenderProvider
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TextBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TextBox.cs
index 8527b094457..8ed5d82ff6f 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TextBox.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TextBox.cs
@@ -17,8 +17,6 @@ namespace System.Windows.Forms
///
/// Represents a Windows text box control.
///
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
[Designer("System.Windows.Forms.Design.TextBoxDesigner, " + AssemblyRef.SystemDesign)]
[SRDescription(nameof(SR.DescriptionTextBox))]
public class TextBox : TextBoxBase
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
index 5a9a3af310b..3dd6d670185 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TextBoxBase.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
/// Implements the basic functionality required by text
/// controls.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent(nameof(TextChanged))]
[DefaultBindingProperty(nameof(Text))]
[Designer("System.Windows.Forms.Design.TextBoxBaseDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ThreadExceptionDialog.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ThreadExceptionDialog.cs
index 7e6988fbffb..2f0ee83c495 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ThreadExceptionDialog.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ThreadExceptionDialog.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
/// Implements a dialog box that is displayed when an unhandled exception occurs in
/// a thread.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class ThreadExceptionDialog : Form
{
private const string DownBitmapName = "down";
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs
index 4953bd967e2..0379b9bf289 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs
@@ -25,8 +25,6 @@ namespace System.Windows.Forms
///
/// ToolStrip control.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DesignerSerializer("System.Windows.Forms.Design.ToolStripCodeDomSerializer, " + AssemblyRef.SystemDesign, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + AssemblyRef.SystemDesign)]
[Designer("System.Windows.Forms.Design.ToolStripDesigner, " + AssemblyRef.SystemDesign)]
[DefaultProperty(nameof(Items))]
@@ -4993,7 +4991,6 @@ internal override bool AllowsChildrenToShowToolTips()
return base.AllowsChildrenToShowToolTips() && ShowItemToolTips;
}
- [ComVisible(true)]
public class ToolStripAccessibleObject : ControlAccessibleObject
{
private readonly ToolStrip owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripButton.ToolStripButtonAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripButton.ToolStripButtonAccessibleObject.cs
index 37acb216116..8519ed8c1bd 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripButton.ToolStripButtonAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripButton.ToolStripButtonAccessibleObject.cs
@@ -14,7 +14,6 @@ public partial class ToolStripButton
///
/// An implementation of AccessibleChild for use with ToolStripItems
///
- [ComVisible(true)]
internal class ToolStripButtonAccessibleObject : ToolStripItemAccessibleObject
{
private readonly ToolStripButton _ownerItem;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContainer.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContainer.cs
index a7db1489b20..383b04bf0bd 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContainer.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContainer.cs
@@ -11,8 +11,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.ToolStripContainerDesigner, " + AssemblyRef.SystemDesign)]
[SRDescription(nameof(SR.ToolStripContainerDesc))]
public class ToolStripContainer : ContainerControl
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContentPanel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContentPanel.cs
index 9b9493a3a7f..1c0635f34e6 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContentPanel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripContentPanel.cs
@@ -11,8 +11,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.ToolStripContentPanelDesigner, " + AssemblyRef.SystemDesign)]
[DefaultEvent(nameof(Load))]
[Docking(DockingBehavior.Never)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.ToolStripControlHostAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.ToolStripControlHostAccessibleObject.cs
index 13d8dbd4d31..25ea923f416 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.ToolStripControlHostAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.ToolStripControlHostAccessibleObject.cs
@@ -14,7 +14,6 @@ public partial class ToolStripControlHost
///
/// Defines the ToolStripControlHost AccessibleObject.
///
- [ComVisible(true)]
internal class ToolStripControlHostAccessibleObject : ToolStripItemAccessibleObject
{
private readonly ToolStripControlHost _ownerItem;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDown.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDown.cs
index 88f874ca9db..5e9fd5e29c4 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDown.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDown.cs
@@ -17,8 +17,6 @@
namespace System.Windows.Forms
{
[Designer("System.Windows.Forms.Design.ToolStripDropDownDesigner, " + AssemblyRef.SystemDesign)]
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class ToolStripDropDown : ToolStrip
{
private ToolStripItem ownerItem = null;
@@ -2228,7 +2226,6 @@ internal static ToolStripDropDown GetFirstDropDown(ToolStrip start)
#endregion DropDownSpecific
- [ComVisible(true)]
public class ToolStripDropDownAccessibleObject : ToolStripAccessibleObject
{
private readonly ToolStripDropDown owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownButton.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownButton.cs
index 5b50cb88edb..c2de79ec968 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownButton.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownButton.cs
@@ -214,7 +214,6 @@ protected internal override bool ProcessMnemonic(char charCode)
///
/// An implementation of Accessibleobject for use with ToolStripDropDownButton
///
- [Runtime.InteropServices.ComVisible(true)]
internal class ToolStripDropDownButtonAccessibleObject : ToolStripDropDownItemAccessibleObject
{
private readonly ToolStripDropDownButton ownerItem = null;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs
index b0f0a664282..2eade432192 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs
@@ -769,7 +769,6 @@ internal override void ToolStrip_RescaleConstants(int oldDpi, int newDpi)
}
}
- [Runtime.InteropServices.ComVisible(true)]
public class ToolStripDropDownItemAccessibleObject : ToolStripItem.ToolStripItemAccessibleObject
{
private readonly ToolStripDropDownItem owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownMenu.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownMenu.cs
index 3f8318dd6fe..fb2004bad38 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownMenu.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownMenu.cs
@@ -15,8 +15,6 @@
namespace System.Windows.Forms
{
[Designer("System.Windows.Forms.Design.ToolStripDropDownDesigner, " + AssemblyRef.SystemDesign)]
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class ToolStripDropDownMenu : ToolStripDropDown
{
private static readonly Padding ImagePadding = new Padding(2);
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripItem.ToolStripItemAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripItem.ToolStripItemAccessibleObject.cs
index 66bcb8889c6..521a60d462e 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripItem.ToolStripItemAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripItem.ToolStripItemAccessibleObject.cs
@@ -17,7 +17,6 @@ public abstract partial class ToolStripItem
///
/// An implementation of AccessibleChild for use with ToolStripItems
///
- [ComVisible(true)]
public class ToolStripItemAccessibleObject : AccessibleObject
{
private readonly ToolStripItem _ownerItem; // The associated ToolStripItem for this AccessibleChild (if any)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripLabel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripLabel.cs
index 623f3145cce..3de669bf6d5 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripLabel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripLabel.cs
@@ -389,7 +389,6 @@ protected internal override bool ProcessMnemonic(char charCode)
return false;
}
- [Runtime.InteropServices.ComVisible(true)]
internal class ToolStripLabelAccessibleObject : ToolStripItemAccessibleObject
{
private readonly ToolStripLabel ownerItem = null;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripMenuItem.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripMenuItem.cs
index 2c369ef5277..f77f21620aa 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripMenuItem.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripMenuItem.cs
@@ -1262,7 +1262,6 @@ internal override bool IsBeingTabbedTo()
///
/// An implementation of AccessibleChild for use with ToolStripItems
///
- [ComVisible(true)]
internal class ToolStripMenuItemAccessibleObject : ToolStripDropDownItemAccessibleObject
{
private readonly ToolStripMenuItem ownerItem = null;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripOverflow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripOverflow.cs
index 98ce4d89059..a8b72cafe14 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripOverflow.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripOverflow.cs
@@ -11,8 +11,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class ToolStripOverflow : ToolStripDropDown, IArrangedElement
{
#if DEBUG
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripPanel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripPanel.cs
index 9a5f8fca11e..b50dae26d3b 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripPanel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripPanel.cs
@@ -16,8 +16,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.ToolStripPanelDesigner, " + AssemblyRef.SystemDesign)]
[ToolboxBitmap(typeof(ToolStripPanel), "ToolStripPanel_standalone")]
public class ToolStripPanel : ContainerControl, IArrangedElement
@@ -1347,8 +1345,7 @@ ArrangedElementCollection IArrangedElement.Children
}
}
- [ListBindable(false),
- ComVisible(false)]
+ [ListBindable(false)]
public class ToolStripPanelRowCollection : ArrangedElementCollection, IList
{
private readonly ToolStripPanel owner;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripSeparator.ToolStripSeparatorAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripSeparator.ToolStripSeparatorAccessibleObject.cs
index 72fd7feb1c2..04e19cf7aa6 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripSeparator.ToolStripSeparatorAccessibleObject.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripSeparator.ToolStripSeparatorAccessibleObject.cs
@@ -13,7 +13,6 @@ public partial class ToolStripSeparator
///
/// An implementation of AccessibleChild for use with ToolStripItems
///
- [Runtime.InteropServices.ComVisible(true)]
internal class ToolStripSeparatorAccessibleObject : ToolStripItemAccessibleObject
{
private readonly ToolStripSeparator _ownerItem;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabel.cs
index 1437977b6d0..a74d7d08d15 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabel.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabel.cs
@@ -246,7 +246,6 @@ protected override void OnPaint(PaintEventArgs e)
}
}
- [ComVisible(true)]
internal class ToolStripStatusLabelAccessibleObject : ToolStripLabelAccessibleObject
{
private readonly ToolStripStatusLabel ownerItem;
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabelBorderSides.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabelBorderSides.cs
index b7ab3981cfe..8d539c2ce42 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabelBorderSides.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripStatusLabelBorderSides.cs
@@ -8,7 +8,6 @@
namespace System.Windows.Forms
{
- [ComVisible(true)]
[Editor("System.Windows.Forms.Design.BorderSidesEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor))]
[Flags]
public enum ToolStripStatusLabelBorderSides
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.cs
index a52760b4ffe..7918731b487 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.cs
@@ -22,8 +22,6 @@ namespace System.Windows.Forms
/// aligned horizontally or vertically. You can also configure how many
/// 'ticks' are shown for the total range of values
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Value))]
[DefaultEvent(nameof(Scroll))]
[DefaultBindingProperty(nameof(Value))]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TreeNodeMouseHoverEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TreeNodeMouseHoverEventArgs.cs
index ea54fae29bf..4d528873da8 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TreeNodeMouseHoverEventArgs.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TreeNodeMouseHoverEventArgs.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
///
/// Provides data for the event.
///
- [ComVisible(true)]
public class TreeNodeMouseHoverEventArgs : EventArgs
{
public TreeNodeMouseHoverEventArgs(TreeNode node)
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs
index 4665d5c83fb..e8e81148af3 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs
@@ -23,8 +23,6 @@ namespace System.Windows.Forms
/// node includes a caption and an optional bitmap. The user can select a node. If
/// it has sub-nodes, the user can collapse or expand the node.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Nodes))]
[DefaultEvent(nameof(AfterSelect))]
[Docking(DockingBehavior.Ask)]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TreeViewHitTestLocation.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TreeViewHitTestLocation.cs
index 252f3bd2b18..8f35ed9a0ac 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/TreeViewHitTestLocation.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/TreeViewHitTestLocation.cs
@@ -11,7 +11,6 @@ namespace System.Windows.Forms
/// Specifies the return value for HITTEST on treeview.
///
[Flags]
- [ComVisible(true)]
public enum TreeViewHitTestLocations
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs
index cb22c4e48c4..9a17f269681 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs
@@ -17,8 +17,6 @@ namespace System.Windows.Forms
///
/// Implements the basic functionality required by an up-down control.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.UpDownBaseDesigner, " + AssemblyRef.SystemDesign)]
public abstract partial class UpDownBase : ContainerControl
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/UserControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/UserControl.cs
index 84d25d75990..4c21fc69d4d 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/UserControl.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/UserControl.cs
@@ -18,8 +18,6 @@ namespace System.Windows.Forms
/// the standard positioning and mnemonic handling code that is necessary
/// in a user control.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[Designer("System.Windows.Forms.Design.UserControlDocumentDesigner, " + AssemblyRef.SystemDesign, typeof(IRootDesigner))]
[Designer("System.Windows.Forms.Design.ControlDesigner, " + AssemblyRef.SystemDesign)]
[DesignerCategory("UserControl")]
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/VScrollBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/VScrollBar.cs
index 934d0691aa9..ff44ba22f7c 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/VScrollBar.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/VScrollBar.cs
@@ -12,8 +12,6 @@ namespace System.Windows.Forms
///
/// Represents a standard Windows vertical scroll bar.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[SRDescription(nameof(SR.DescriptionVScrollBar))]
public class VScrollBar : ScrollBar
{
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs
index 95119d61256..818caabf410 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs
@@ -19,8 +19,6 @@ namespace System.Windows.Forms
///
/// This is a wrapper over the native WebBrowser control implemented in shdocvw.dll.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Url))]
[DefaultEvent(nameof(DocumentCompleted))]
[Docking(DockingBehavior.AutoDock)]
@@ -1445,7 +1443,6 @@ private Mshtml.IWebBrowser2 AxIWebBrowser2
/// Provides a default WebBrowserSite implementation for use in the CreateWebBrowserSite
/// method in the WebBrowser class.
///
- [ComVisible(false)]
protected class WebBrowserSite : WebBrowserSiteBase, IDocHostUIHandler
{
///
diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowserBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowserBase.cs
index 2e728938760..69aa390e611 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowserBase.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowserBase.cs
@@ -30,8 +30,6 @@ namespace System.Windows.Forms
///
/// The classid of the ActiveX control is specified in the constructor.
///
- [ComVisible(true)]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultProperty(nameof(Name))]
[DefaultEvent(nameof(Enter))]
[Designer("System.Windows.Forms.Design.AxDesigner, " + AssemblyRef.SystemDesign)]
diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WebBrowserTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WebBrowserTests.cs
index 5f667f90846..34b2ff1e131 100644
--- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WebBrowserTests.cs
+++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WebBrowserTests.cs
@@ -1261,7 +1261,7 @@ public void WebBrowser_IsWebBrowserContextMenuEnabled_SetWithInstance_GetReturns
public static IEnumerable