TxtRL.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Drawing;
using System.Windows.Forms;
namespace TxtRL
{
/// <summary>
/// 下载于51aspx.com
/// </summary>
public partial class TxtRL : TextBox
{
public TxtRL()
{
InitializeComponent();
this.Click += new EventHandler(TextRL_Click);
this.KeyPress += new KeyPressEventHandler(TextRL_KeyPress);
}
private RL rl = new RL();
protected Point p;//鼠标位置
/// <summary>
/// 获取焦点则展示日历
/// </summary>
private void TextRL_Click(object sender, EventArgs e)
{
rl.txtRQ = this;
rl.Show();
}
/// <summary>
/// 只能输入数字
/// </summary>
private void TextRL_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar))//判断输入是否为数字
{
e.Handled = true;//已经处理此事件
}
else if (e.KeyChar != 8)
{
#region 日期格式控制 YYYY-MM-DD
string val = this.Text;
int len = val.Length;
if (len == 4 || len == 7)
{
val += "-";
if (len == 4 && e.KeyChar > 49)//月份十分位大于1
{
val += "0";
}
else if (len == 7)
{
if (e.KeyChar > 51)//日期十分位大于3
{
val += "0";
}
else if (e.KeyChar == 51 && val.Substring(5, 2) == "02")
{
val += "0";
}
}
}
后面还有 82 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。