V
V
Vasily Pupkin2018-05-24 07:04:22
C++ / C#
Vasily Pupkin, 2018-05-24 07:04:22

Constructor for type 'test1.Form1' not found. Why does the window designer break?

A very simple program. Two form inheritance.
Why can't Form2 be opened in the window designer?
"Constructor for type "test1.Form1" not found."
What should I do, tell me?

using System;
using System.Windows.Forms;

namespace test1
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form2("Тествая строка"));
        }
    }
}

namespace test1
{
    public partial class Form2 : Form1
    {
        public Form2(string text) : base(text)
        {
            InitializeComponent();
        }
    }
}

namespace test1
{
    public partial class Form1 : TForm
    {
        public Form1(string text) 
        {
            InitializeComponent();
            label1.Text = text;
        }
    }
}

using System.Windows.Forms;

namespace test1
{
    public partial class TForm : Form
    {
        public TForm()
        {
            InitializeComponent();
        }
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question