Drawing lines in Visual Studio for Compact Framework 2.0

I'm looking for a toolkit to allow me to draw lines and boxes at design time in Visual Studio 2008 for .NET Compact Framework 2.0.

I've looked over the VisualBasic PowerPacks but that seems to be available only for desktop .NET.

Does anyone know of any such tool?


Are you using WinForms? A lot of the controls implement a Site property which returns this type http://msdn.microsoft.com/en-us/library/system.componentmodel.isite.aspx is has a DesignMode property which you can use to check if it's in design mode or not.

In the void OnRender(...) method you can check this property if it's set or not and you can then draw depending on design time or not.

protected override void OnRender(...)
{
    if (this.Site != null && 
        this.Site.DesignMode) 
    {
        // Draw something...
    }
}

Check out this post about potentional problems with Site and the DesignMode property http://decav.com/blogs/andre/archive/2007/04/18/1078.aspx

链接地址: http://www.djcxy.com/p/53646.html

上一篇: 以编程方式在桌面上创建MS SQL Compact数据库文件

下一篇: 在Visual Studio for Compact Framework 2.0中绘制直线