上次一时兴起,做了一个仿金蝶的凭证金额输入的控件,今天使用了下,真的奇陋无比,所以花了几个小时加强了点功能
主要有增加以下功能
1、实现整数和小数位的分开
2、在得到焦点的时候能控制在整数位
3、在输入“.”的时候可以自动跳转到小数位(红线后)
4、能设置和获得原始的数据
以下是示意图

using System;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Voucher
{
    [DefaultProperty("jText")]
    [ToolboxData(@"<{0}:VoucherInput jText = ''  
    runat='server'></{0}:VoucherInput>")
    ]
    //设置默认的属性
    public class VoucherInput : WebControl
    {
      
        private TextBox _TextBox;    //整数位
        private TextBox _PTextBox;   //小数位

        属性





























 Properties delegated to child controls

        方法



































 Overriden methods

    }
}

 

总结
现在还是不满意,比如删数据的时候还是小数位和整数位分开发删除,目前还没有具体的想法

posted on 2014-01-22 11:32  EricLi  阅读(306)  评论(0编辑  收藏  举报