468,720 Members | 1,591 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,720 developers. It's quick & easy.

Controls disappearing from WinForm.

Hello, I have a form that contains the Browser control (via interop, of
course) among other things. The browser control is in a Panel control.
When I add other controls (such as splitter and some others), the
controls seem to randomly either disappear or move to different Panels,
etc... For instance, I've sized the browser to 100x100 and it will
resize itself to a much larger size. Then I'll add a splitter after
several trips to code and then to the forms designer, the splitter will
just disappear. Closer code inspection reveals that in the code that's
generated by the windows designer, the splitter control is removed from
the this.Controls.Add(...) statement. And the browser control simply
changes it's size (in code too).

What's going on? Has anyone experienced this?

Thanks
Nov 16 '05 #1
4 3842
Frank,

I've been having this problem for quite some time, and that's why I'm poking
around here -- looking for some answers.

Here's what I've been seeing. When I open VS and open my form, my controls
are there and all's well. When I hit F5 to run the app and then close it to
return to VS, I get numerous error messages in the task list that say "Member
not found." That's the first sign that it deleted my controls. If I close
VS without saving those changes, I can reopen VS and my controls will still
be there until the next time I debug the app from VS. But if I miss those
messages and save the changes, VS will have removed the ...Controls.Add(xxx)
from the generated code.

VERY FRUSTRATING and a real productivity killer.

I'm hoping someone will reply and tell us there are some hotfixes for this
one!

Good luck!
Vince
Nov 16 '05 #2
Several possibilities, I would suggest you confirm it happens on another
installation of VS. Also check that you haven't manually added your own code
to add buttons etc.. to VS generated region of code.

"Vince" <vi***@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Frank,

I've been having this problem for quite some time, and that's why I'm
poking
around here -- looking for some answers.

Here's what I've been seeing. When I open VS and open my form, my
controls
are there and all's well. When I hit F5 to run the app and then close it
to
return to VS, I get numerous error messages in the task list that say
"Member
not found." That's the first sign that it deleted my controls. If I
close
VS without saving those changes, I can reopen VS and my controls will
still
be there until the next time I debug the app from VS. But if I miss those
messages and save the changes, VS will have removed the
...Controls.Add(xxx)
from the generated code.

VERY FRUSTRATING and a real productivity killer.

I'm hoping someone will reply and tell us there are some hotfixes for this
one!

Good luck!
Vince

Nov 16 '05 #3
Evan,

There are only 2 other developers here with me, but they both experience the
exact same thing and can reproduce the exact same scenario.

There's no manual code in the generated sections. We know to stay out of
there.

Thanks,
Vince
Nov 16 '05 #4
I figured out how to work around my problem! I read in a hotfix bulletin
that the "fixed" problem was isolated to C# and solutions that contain
multiple projects. Wel, I'm not going to port everything from C#, but I can
easily remove extra projects from my solution. When I removed all but the
main project, the controls stopped disappearing!

So obviously the hotfix that was supposed to fix this problem didn't fix it,
but the workaround takes care of it.

I hope this solution finds its way to others with this problem, and helps
them too, because WHAT A PAIN!

Thanks,
Vince
Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by neptune | last post: by
4 posts views Thread by Steve | last post: by
2 posts views Thread by Rachel Suddeth | last post: by
8 posts views Thread by Sunil Menon | last post: by
6 posts views Thread by George Yefchak | last post: by
2 posts views Thread by Robert W. | last post: by
9 posts views Thread by bryonone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.