.NET 8 in Winforms removes code in designer.cs, how to avoid this?

We have a Winforms project upgraded to .NET 8. The conversion had only a few problems that where easily fixed, so we continued on this path.
However, now I found a problem that I suspect is a bug in Winforms designer on .NET 8.

I have a custom control, and a panel on that control marked as a “dropzone”, so you can drop controls on this custom control in the designer. This worked well until the move to .NET 8.

Here is a snippet of the custom control’s code:

[Designer(typeof(UserControlDesigner))]
[Serializable]
public partial class gttDXGridDashboard : UserControl
{ 
  // define a property called "DropZone"
  [Category("Appearance")]
  [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
  public PanelControl DropZone
  {
      get { return panelControlCustom; }
  }

  // ...
}

public class UserControlDesigner : ParentControlDesigner
{
    public override void Initialize(IComponent component)
    {
        base.Initialize(component);

        if (Control is gttDXGridDashboard dashboard)
        {
            bool result = EnableDesignMode(dashboard.DropZone, "DropZone");
            // this writeline never shows, maybe because it's in a control from the toolbox ?
            Console.WriteLine($"EnableDesignMode(dashboard.DropZone, "DropZone") = {result}");
        }
    }
}

Now for the problem: in a form that has a gttDXGridDashboard on it, and has a button in the dropzone, the designer.cs looks like this:

  // gttDXGridDashboardList.DropZone
  // 
  this.gttDXGridDashboardList.DropZone.Controls.Add(this.gttDXSimpleButtonAddMultipleChassis);

This worked well while the project was running on the .NET framework, but since the move to .NET 8, this line in the designer.cs is removed from the moment I drop another control on the dropzone, or even when I for example move the existing button (gttDXSimpleButtonAddMultipleChassis) a bit to the right or left

At that moment, the button gttDXSimpleButtonAddMultipleChassis still exists on the form, but has no parent anymore and thus is invisible and unusable.

I tried updating all packages, rebuilding all sources, restarted VS, but no results.

Then I wanted to make a workaround, and write some code that will put all the controls without a parent back onto the dropzone, but I don’t know how to search for controls that have no parent, I cannot loop over this.Controls because these controls have no parent anymore.

So I need a little help here.

Did I do something wrong with defining the dropzone?

Is this a know bug/problem and if so is there a fix/workaround?

If all fails, how can I find controls that have no parent?

I know I can always write code in the forms that have this problem to put the controls back, but that would mean writing almost the same code again in several forms, I want a more generic workaround.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật