Sytuacja wejściowa: mamy aplikację w WinForms z jednym formularzem o nazwie “Form1”. Przechodzimy do code behind formularza i dopisujemy u góry definicję naszej własnej klasy, na przykład tak:

 

namespace BLToolkitTests
{
    class MyClass
    {

    }

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

Po zapisaniu pliku Form1.cs i przejściu do designera formularza, otrzymamy komunikat błędu o treści:

The class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.