Home > Net >  How to make the data in the textbox in c # WINFORM in a fixed time for record
How to make the data in the textbox in c # WINFORM in a fixed time for record

Time:02-04


, as shown in the textbox is real-time data acquisition, but I want to let it change a 30 seconds, the how to use the timer, which use the timer function, beg god told
I add a sleep before the record of statements, result in PC open in the crash state,

CodePudding user response:

 
The Timer time=new Timer (30 * 1000);
Time. Elapsed +=Time_Elapsed;
Time. The Start ();


Private void Time_Elapsed (object sender, ElapsedEventArgs e)
{
This. The textbox. Text="10.00";
}

CodePudding user response:

Open a thread, special read data to modify text box
  •  Tags:  
  • C#
  • Related