SelectionStart就可以获取当前的插入符的位置
你试试下面这个例子:
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
button1.Text = textBox1.SelectionStart.ToString();
}
你试试下面这个例子:
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
button1.Text = textBox1.SelectionStart.ToString();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货