using delay in tab control before the data is insert into textbox in wpf -


i new in wpf. using tabcontrol. , there 2 tabs. want on change tab contents of tab load. , inserting text in text box. want delay of 5 sec before text insert in textbox. illustrate images. below open tabcontrol.

enter image description here

when click on connect display following.

enter image description here

on right side there textbox text "vokkey, dave". want after tab load it's wait 5 second , text "vokkey,dave" appear in textbox. on event should work.? , delay should do?

it customary use dispatchertimer these situations... put usercontrol:

in constructor:

loaded += yourcontrol_loaded; 

then in code behind of usercontrol:

private void yourcontrol_loaded(object sender, routedeventargs e) {     dispatchertimer timer = new dispatchertimer();     timer.interval = new timespan(0, 0, 5);     timer.tick += timer_tick;     timer.start(); }  ...  private void timer_tick(object sender, eventargs e) {     textbox.text = "vokkey, dave";     timer.stop(); } 

you can find out more dispatchertimer dispatchertimer class page @ msdn.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -