日期:2012-02-05  浏览次数:20418 次

//==========================================================================
//名称: 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.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using ZYQ;
using ZYQ.WebControls.Cultural.DateTimePick;   
namespace ZYQ.WebControls.Cultural.DateTimePick
{
    
    /// <summary>
    /// DateTimePickLabel由System.Web.UI.WebControls.Label继承。
    /// 使用System.Globalization.CultureInfo类来显示格式化了的时间。
    /// </summary>
    [ToolboxData("<{0}:DateTimePickLabel runat=server></{0}:DateTimePickLabel>")]
    public class DateTimePickLabel : System.Web.UI.WebControls.Label
    {
        #region 私有变量定义
        private bool _autofit;
        private DateTime _dt;
        private string text;
        private DateFormatOption _dfo;
        private DTFormatSetting dateTimeSet;
        zyqCultrueInfo myInfo;
        #endregion
        #region 属性
        [Bindable(true),Browsable(false),
            Category("Appearance")]
        public override string Text
        {
            get
            {
                return text;
            }

//            set
//            {
//                text =value;        
//            }
        }
        [Browsable(true),Category("Behavior"),DefaultValue(false),Description("设定是否自动适应客户端浏览器的文化区域设定。如果此属性为true,则DateTimeFormatShow属性的所有设置将被忽略。")]
        public bool AutoFitClientBrowser
        {
            get{ return this._autofit;}
            set{this._autofit = value;}
        }

        [Browsable(true),Category("日期时间设置"),Description("设定日期"),Bindable(true)]
        [RefreshPrope