c# - View Input Text for a second in TextBox and change to passwordchar -
It's the same but the last answer I wanted was I need c # wpf ... I tried the last answer but I Can not seem to get .. Sometimes the key can be pressed, and sometimes it is not. How can I get the same interval when press the key?
private Zero TextBox_KeyDown (Object Sender, KeyEventArgs E) {dispatcherTimer.Tick + = New EventHandler (dispatcherTimer_Tick); Sender Timer. Interval = New TimeSpain (0, 0, 0, 1); DispatcherTimer.Start (); } I tried
Sender Timer Interval = timespan Foamseconds (5);
edit
Private Zero Dispatcher TimerType (Object Sender, EventArgs E) {string Str = ""; (Int i = 0; i & lt; txtPass.Text.Length; i ++) str + = char.ConvertFromUtf32 (8226); TxtPass.Text = str; TxtPass.Select (txtPass.Text.Length, 0); }
You do not need to subscribe to the new event handler each time. Just do it once in the constructor
dispatcher timer = new dispatch timer (); Sender Timer. Tick + = sender timer; Sender Timer. Interval = New TimeSpain (0, 0, 0, 1); In the keydown event, just reset timer (unfortunately we do not have any reset method )
Private Zero Text Box / Kida (Object Sender, KeyEventArgs e) {dispatcherTimer.Stop (); DispatcherTimer.Start (); } Just like the timer, just stop the stop the timer and do your work
zero sendimetric (object sender, event cargo e) {Dispatcher Timer. Stop (); // your code}
Comments
Post a Comment