User controls in design view

  • Thread starter Thread starter RobC
  • Start date Start date
R

RobC

I am using user controls in a WM6 app (VS2005) - the user controls were
visible in the design view - but on reload of the solution the user control
content is no longer visible with VS opting to show only the placeholders -
is there a setting/option to show the control content in design mode?
 
You will need to add a .xmta file to your project to let the designer know
that your custom control is safe for desktop if it is. In this file you can
put the following to tell the designer to render your control:

<Class Name="yourclassnamegoeshere">
<DesignTimeVisible>true</DesignTimeVisible>
<DesktopCompatible>true</DesktopCompatible>
</Class>
 
You will also need to be careful not to make any device specific calls in
your constructor and paint methods. Visual Studio will complain about it.

You can check the if the platform is Windows CE
(Environment.OSVersion..Platform == PlatformID.WinCE) or check if the
component is in DesignMode through the ISite property. check if the
component's Site property is NULL or Site.DesignMode is FALSE
 
Back
Top