diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.TransparentBehavior.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.TransparentBehavior.cs
index 0d6b6abcd5a..3aca677c525 100644
--- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.TransparentBehavior.cs
+++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ControlDesigner.TransparentBehavior.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#nullable disable
-
using System.Drawing;
using System.Windows.Forms.Design.Behavior;
@@ -34,7 +32,7 @@ internal class TransparentBehavior : Behavior.Behavior
///
/// Forwards DragDrop notification from the BehaviorService to the related ControlDesigner.
///
- public override void OnDragDrop(Glyph g, DragEventArgs e)
+ public override void OnDragDrop(Glyph? g, DragEventArgs e)
{
_controlRect = Rectangle.Empty;
_designer.OnDragDrop(e);
@@ -43,20 +41,20 @@ public override void OnDragDrop(Glyph g, DragEventArgs e)
///
/// Forwards DragDrop notification from the BehaviorService to the related ControlDesigner.
///
- public override void OnDragEnter(Glyph g, DragEventArgs e)
+ public override void OnDragEnter(Glyph? g, DragEventArgs e)
{
if (_designer is not null && _designer.Control is not null)
{
_controlRect = _designer.Control.RectangleToScreen(_designer.Control.ClientRectangle);
}
- _designer.OnDragEnter(e);
+ _designer?.OnDragEnter(e);
}
///
/// Forwards DragDrop notification from the BehaviorService to the related ControlDesigner.
///
- public override void OnDragLeave(Glyph g, EventArgs e)
+ public override void OnDragLeave(Glyph? g, EventArgs e)
{
_controlRect = Rectangle.Empty;
_designer.OnDragLeave(e);
@@ -65,7 +63,7 @@ public override void OnDragLeave(Glyph g, EventArgs e)
///
/// Forwards DragDrop notification from the BehaviorService to the related ControlDesigner.
///
- public override void OnDragOver(Glyph g, DragEventArgs e)
+ public override void OnDragOver(Glyph? g, DragEventArgs e)
{
// If we are not over a valid drop area, then do not allow the drag/drop. Now that all
// dragging/dropping is done via the behavior service and adorner window, we have to do our own
@@ -82,7 +80,7 @@ public override void OnDragOver(Glyph g, DragEventArgs e)
///
/// Forwards DragDrop notification from the BehaviorService to the related ControlDesigner.
///
- public override void OnGiveFeedback(Glyph g, GiveFeedbackEventArgs e)
+ public override void OnGiveFeedback(Glyph? g, GiveFeedbackEventArgs e)
{
_designer.OnGiveFeedback(e);
}