User Controls Are Disappearing!

  • Thread starter Thread starter Marauderz
  • Start date Start date
M

Marauderz

OK, this is frustrating... my whole UI is created based on User controls.
But every now and then when I open the desginer the controls jsut
DISAPPEAR!!! Pooff!!!

The definition of the control is still there in the form designer generated
code..
the part thats says
public withevents mycontrol as controltype
that is... eveyrthing else is gone!

The controls are placed within a tab page.. I thought I heard somewhere that
that might cause a problem, can anyone confirm and tell me what's wrong?

Thanks.
 
sounds like it may be a bug... have you tried replicating the problem with a
test project? Also, the vsnet designers sometimes screw up when working with
an extensive amount of content. are your builds executing ok?

Ellery Familia
 
Builds executing fine... but the controls are disappearing from the designer
and just pissing my team off.. :P
 
We had this issue when using custom User Controls. The issue is that if you
define properties on you user controls then drop them in a container, the
container (Form or higher-level User Control) will attempt to serialize the
value for all properties to code and to the resx file. If you properties
are of custom types then the serialization fails and havock breaks loose.
Two solutions: 1) Provide a custom type serializer (I haven't done this, but
it is possible), or 2) mark your properties with the following Attribute:
<DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)>.



This will suppress the innate desire of the container to serialize the value
of that property for your user control.
 
Back
Top