The error message is as follows:
Class treemenuview can be designed, but it is not the first class in the file. Visual Studio requires the designer to use the first class in the file. Move the class code to make it the first class in the file, and then try to reload the designer.
Hide
In system. componentmodel. Design. serialization. codedomdesignerloader. ensuredocument (idesignerserializationmanager Manager)
In system. componentmodel. Design. serialization. codedomdesignerloader. Duplicate mload (idesignerserializationmanager Manager)
In Microsoft. visualstudio. Design. serialization. codedom. vscodedomdesignerloader. receivmload (idesignerserializationmanager serializationmanager)
In system. componentmodel. Design. serialization. basicdesignerloader. beginload (idesignerloaderhost host)
Cause:
The error code is as follows:
Correct code: for example, (replace the bits of the two methods to be OK)
After comparison, you will find that the only difference between the two code segments is that the two classes are in the opposite position. In this case, it may be concluded that for vs.2005, for programming convenience, the post-code of treemodulview is put into two files with the keyword partial. The two files are a whole and a class. Therefore, vs.2005 automatically matches the treemodulview when loading the Form Designer. the first class in the CS form, so if you occupy the position of the first class, vs.2005 will match it when loading the Form Designer, because they do not match, so the above errors will occur.
Some people say this may be a bug in vs2005. for developers, pay attention to it.