刚写好的Asp.Net时间和日期的Label控件。作为讲解Asp.net控件开发的第一部分:继承开发(4)-.Net技术-3P代码网
繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> 组件控件开发 >> 刚写好的Asp.Net时间和日期的Label控件。作为讲解Asp.net控件开发的第一部分:继承开发(4)

刚写好的Asp.Net时间和日期的Label控件。作为讲解Asp.net控件开发的第一部分:继承开发(4)

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:6  文字大小:【】【】【
简介://========================================================================== //名称: ZYQ.WebControls.Cultural.DateTimePick.DateTimePickLabel //       Asp.Net服...

//==========================================================================

//名称: ZYQ.WebControls.Cultural.DateTimePick.DateTimePickLabel

// Asp.Net服务控件

//版本: 1.0.0.0

//作者: 张宇庆

//日期: 2003.2.12

//Email: raxzhang@sina.com

//说明: 本控件及源代码只是为《计算机世界》开发者俱乐部Asp.Net论坛学习如何开发Asp.net

// 服务器端控件而开发。未经本人同意请勿用作商业用途。

//

//==========================================================================

using System;

using System.ComponentModel;

using System.Drawing.Design;

using System.Windows.Forms;

using System.Windows.Forms.Design;

using ZYQ.WebControls.Cultural.DateTimePick;

namespace ZYQ.WebControls.Cultural.Design

{

///

/// ZYQ 的摘要说明。

///

public class DateTimePickDesign:UITypeEditor

{

public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)

{

return UITypeEditorEditStyle.Modal;

}

public override object EditValue(ITypeDescriptorContext context,IServiceProvider provider,object value)

{

object retvalue=value;

IWindowsFormsEditorService srv=null;

//

if(provider !=null)

srv=(IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

if(srv!=null)

{

DateTimePickEditor form= new DateTimePickEditor();

form.DesignerSetting =(DTFormatSetting)value;

if(srv.ShowDialog(form)==DialogResult.OK)

return form.DesignerSetting;

}

return retvalue;

}

}

}

责任编辑:admin
相关文章