Be sure that form class is the first class declaration in the file. (else the code editor is used as default)
public partial class [some_form_name] : Form