private void Button_Click_1(object sender, RoutedEventArgs e)
{
int index = tbx.SelectionStart;
if (tbx.SelectionLength > 0)
{
tbx.Text = tbx.Text.Remove(tbx.SelectionStart, tbx.SelectionLength);
tbx.SelectionStart =index;
}
else if (tbx.SelectionStart < tbx.Text.Length)
{
tbx.Text = tbx.Text.Remove(tbx.SelectionStart, 1);
tbx.SelectionStart = index;
}
tbx.Focus();
}
那你直接往文本框送这两个按键不就行了