I managed to work around this... (after about four hours of frustration).
What I saw is
a) it has nothing to do with your source code. I had the project duplicated on my development machine and on a laptop. Exactly the same form code worked in one place, but gave these problems in the other place. Copying the good source code into the project with problems made no difference at all.
b) I had the solution under source control. I finally just checked everything in, deleted the whole project tree on my dev machine, and checked it all out again in pristine form, and the problem was gone...
---------------------
What I infer from this is ...
a) If you have a source control system, start afresh.
b) If not, you may salvage your work by copying all the source code to a brand new folder and opening a new project on it.
c) There are probably some project files or pre-built headers or cache files that somehow got screwed. If we could find out which, or why, we could probably just removing them. But I know not ...
peter