插入:(光标处插入)
string s = txtCode.Text;
idx = txtCode.SelectionStart;
s=s.Insert(idx, "T")
txtCode.Text = s;
txtCode.SelectionStart = idx+1;
txtCode.Focus();
回退:(光标处退格)
string s=txtCode.Text;
idx = txtCode.SelectionStart;
if (idx > 0)
{
txtCode.Text = s.Substring(0, idx - 1) + s.Substring(idx);
txtCode.SelectionStart = idx - 1;
}
else
{
txtCode.SelectionStart = 0;
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |