-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
🪲 bugProduct bug (most likely)Product bug (most likely)💥 regression-previewRegression from a preview releaseRegression from a preview release
Description
.Net Core version: 3.0.1
OS version: win10 64-bit
Please try my sample, when add MS control to Panel, there's always an exception occurred:
///
/// exception occurred when they are added to Panel, I believe there're more MS controls have same issue.
///
///this.panel1.Controls.Add(new ToolStripDropDown());
//this.panel1.Controls.Add(new ToolStripDropDownMenu());
//this.panel1.Controls.Add(new ContextMenuStrip());
//this.panel1.Controls.Add(new ToolStripDropDown());
//this.panel1.Controls.Add(new DataGridViewTextBoxEditingControl());
this.panel1.Controls.Add(new DataGridViewComboBoxEditingControl());System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Forms.DataGridViewComboBoxEditingControl.OnHandleCreated(EventArgs e) in /_/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs:line 164
at System.Windows.Forms.Control.WmCreate(Message& m) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs:line 12452
at System.Windows.Forms.Control.WndProc(Message& m) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs:line 13486
at System.Windows.Forms.ComboBox.WndProc(Message& m) in /_/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs:line 4051
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs:line 65
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs:line 113
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) in /_/src/System.Windows.Forms/src/System/Windows/Forms/NativeWindow.cs:line 626
I checked the source code, this bug dues to some internal control override OnHandleCreated method, but didn't check if parent control exists or not, see below:
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
dataGridView.SetAccessibleObjectParent(this.AccessibilityObject);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🪲 bugProduct bug (most likely)Product bug (most likely)💥 regression-previewRegression from a preview releaseRegression from a preview release