同样的问题 ,因为这一个,但最后的答案是一个我想要的。我需要C#WPF ...我想最后的答案,但我似乎无法得到间隔..有时按下该键可以看出,有时它不..我怎么能得到相同的间隔时,按键?
private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1);
dispatcherTimer.Start();
}
我试过了
dispatcherTimer.Interval = TimeSpan.FromSeconds(5);
但还是一样...
编辑
private void dispatcherTimer_Tick(object sender, EventArgs e)
{
string str = "";
for(int i = 0; i < txtPass.Text.Length; i++)
str += char.ConvertFromUtf32(8226);
txtPass.Text = str;
txtPass.Select(txtPass.Text.Length, 0);
}