Search code examples
c#winformscomboboxownerdrawn

The class CheckComboBox can be designed, but is not the first class in the file.


i am developing a winform application which has an owner drawn combobox with check boxes. but in visual studio i am facing following erroe

" The class CheckComboBox 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 how to Move the class code so that it is the first class in the file ??

i checked previous posts regarding the same but not getting it.

please help.. thanks in advance.


Solution

  • Finally i got the answer. i was reading the error and suddenly it clicked. in the namespace, CheckComboBox should be the first class ( means it should be always the first class and if you have any other class in the namespace, put it after)

        namespace **xyz**
     {
         class **xyz** 
         {
         }  
         class pqr 
         {
         }
    }