How to inherit form in .net design time (there is no inheritance picker)?

Slobodan Krejaković 41 Reputation points
2024-06-23T12:50:32.3366667+00:00

How can I correctly inherit from some template form at design time in VS, on .net?

In .net framework there was Inheritance Picker but I do not find it in .net 8.0.

When I create simple inheritance from another form, like this:

public partial class InheritedForm : BaseForm
{
    public InheritedForm()
    {
        InitializeComponent();
    }
}

I get errors when trying to show Designer:

User's image

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,888 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,822 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,884 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KOZ6.0 6,395 Reputation points
    2024-06-24T12:45:58.06+00:00

    The form designer executes the constructor of the inherited source and calls the InitializeComponent method.

    When designing BeseForm, the constructor of BaseForm is not executed; the constructor of BaseForm is executed when designing InheritedForm.

    When saving System.Drawing.Font in the Settings file, set as follows.

    aaaaa


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.