private delegate void InvokeControl( string text); private InvokeControl invokeControl; private void Form1_Load(object sender, EventArgs e) { invokeControl = ModifyLabel; Thread thd = new Thread(new ThreadStart(LaunchTread)); thd.Start(); } private void LaunchTread() { for ( int i = 0 ; i < Int32.MaxValue ; i++) { label1.Invoke(invokeControl, i.ToString()); Thread.Sleep(300); } } private void ModifyLabel(string text) { label1.Text = text; }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question