On Fri, 18 May 2007 19:24:01 -0700, GT <GT@discussions.microsoft.com>
wrote:
[...]
It is only when I am going to the event from the graphical Form [Design]
page that it puts me in the wrong place (I assume it is sending me to the
place where it used to be before I moved it). The real annoying thing
though is that sometimes it automatically creates the event as if it
hadn't
been created (a blank prototype)... and this of course forces me to
select
the blank one and delete it for everything to build fine.
Is there another way to move them that you use? (because it sounds like I
shouldn't be having this issue)
For what it's worth, I went and tried what you did, and ran into the same
problem. It's trivial to reproduce. I was unable to find any magic file
I could delete and get things to work. I did find that when I deleted the
hidden "cache" file that sits in the directory with the main solution
file, that VS forgot the offset into the original Form1.cs file where the
event handler was (before I did that, double-clicking on the event took me
to where the handler used to be).
So I suspect that the cache file is the correct magic file, but how to get
it to point to the right location, I don't know. It may be that deleting
all the event handlers and hooking them back up is the only way. :(
On top of all that, I found that when I added a new "Code File" where I
moved the event handler to, double-clicking the code file in the Solution
Explorer took me to a bogus form designer window. I say "bogus", because
it wasn't even my actual form...it was missing all the controls. And as
if that weren't bad enough, when I double-clicked on the form, it added a
new Load event handler in my new CodeFile1.cs file, _and created a whole
new "InitializeComponent()" method_! Duh.
It seems to me that VS has some serious bugs in dealing with the designer
versus "partial". Given that it does somehow manage to avoid getting
confused between Form1.cs and Form1.Designer.cs, I suspect they've
hard-coded some special cases or something, but the more general situation
trips it up. Boo!
Pete