Disappearing controls

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi All,

I've seen many postings regarding different situations where controls
disappear but have never seen a decent solution.

Here is the problem. I have a form onto which I am placing some
standard controls from the toolbox (mainly radio buttons and labels.)

The form itself derives from a base Form which derives from
System.Windows.Forms.UserControl. I do this as the base form has a
standard header which I wish to use on all derived forms.

Quite often when I rebuild the code a control vanishes from the design
view. It is still available via the properties combo (or if you look
at the Component Designer generated code, but usually the size has
been set to (0,0) or some other property is randomly deleted (such as
the text in the case of the label control)

Microsoft describe a very similar problem on their web-site and
provide a patch but the patch is for .NET 2002 and I am using .NET
2003 and so the patch won't install.
(http://msdn.microsoft.com/vstudio/downloads/updates/datalossifx.aspx)

Hopefully I have described all relevant information here.

Does anyone know how to stop this from happening?

Cheers,
Steve
 
Steve,

Yes, I have experiencedd the same problem with both 2002 and 2003. It is
sporadic and I can never figure out what causes it. However, the work
around I use is to close the Designer View and recompile. Then open the
form after it has compiled in the designer and the controls somehow
magically re-appear.

A similar issue I have is sometime the Tab pages of the TabConrol shift out
of order. If I have 6 Tabs, and add a 7th, the index order gets mangled.

Sorry, I don't have a better fix.

Fritz
 
:

[Re: Disappearing controls in Visual Studio]
Yes, I have experiencedd the same problem with both 2002
and 2003. It is sporadic and I can never figure out what
causes it. However, the work around I use is to close the
Designer View and recompile. Then open the form after it
has compiled in the designer and the controls somehow
magically re-appear.

My experience has been that this occurs often when you have created
a user control (or custom control), placed it on a form, and then
make a change to the user control itself. Let's say you realize that
your user control needs an extra button, or whatever. You make the
change, compile, and suddenly the control disappears from your form.

Doesn't happen every time but quite often. My impression is that the
environment is having a hard time loading (or whatever term is
appropriate) the user control after it has changed. But I don't
know. My work around is the same as yours.
A similar issue I have is sometime the Tab pages of the
TabConrol shift out of order. If I have 6 Tabs, and add a
7th, the index order gets mangled.

Oh yeah, I've had this happen, too.
 
Wave,

Yes there is usually a custom control on the WinForm.

I just wish it would do it everytime or not at all:)

Fritz


Wavemaker said:
:

[Re: Disappearing controls in Visual Studio]
Yes, I have experiencedd the same problem with both 2002
and 2003. It is sporadic and I can never figure out what
causes it. However, the work around I use is to close the
Designer View and recompile. Then open the form after it
has compiled in the designer and the controls somehow
magically re-appear.

My experience has been that this occurs often when you have created
a user control (or custom control), placed it on a form, and then
make a change to the user control itself. Let's say you realize that
your user control needs an extra button, or whatever. You make the
change, compile, and suddenly the control disappears from your form.

Doesn't happen every time but quite often. My impression is that the
environment is having a hard time loading (or whatever term is
appropriate) the user control after it has changed. But I don't
know. My work around is the same as yours.
A similar issue I have is sometime the Tab pages of the
TabConrol shift out of order. If I have 6 Tabs, and add a
7th, the index order gets mangled.

Oh yeah, I've had this happen, too.
 
Thanks for the help guys. At least now I have a way of getting the
controls back which will help a lot. Having to recreate a control
that had already dissapeared twice was starting to get way tedious!

In my case the controls that are disappearing are not custom controls
but they are on a custom form, so I guess the IDE has issues with you
customising things.

From what I gather this problem has been around for a while, have
Microsoft stopped supporting this product aleady!!!
 
Back
Top