简陋的会计凭证金额输入控件(加强)
上次一时兴起,做了一个仿金蝶的凭证金额输入的控件,今天使用了下,真的奇陋无比,所以花了几个小时加强了点功能
主要有增加以下功能
1、实现整数和小数位的分开
2、在得到焦点的时候能控制在整数位
3、在输入“.”的时候可以自动跳转到小数位(红线后)
4、能设置和获得原始的数据
以下是示意图
代码如下
现在还是不满意,比如删数据的时候还是小数位和整数位分开发删除,目前还没有具体的想法
主要有增加以下功能
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
}
}
总结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 2006-10-27 14:46 jiekengxu 阅读(3032) 评论(8) 编辑 收藏 举报