User controls in design view

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?
 
C

CraigDahlinger

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>
 
C

Christian Resma Helle

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top