Zdravím Vás,potřeboval bych poradit s jednoduchým kódem, který jsem vytvořil ve Visual Studiu 2013 (C#). Jedná se o okenní aplikaci. Na stisk tlačítka se mi vytvoří nové vlákno, které mi vyhodí hlášku o tom, že vlákno běží a dále mi má změnit text v LABELu, což nefunguje. Nevíte proč?using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Threading;namespace WindowsFormsApplication1{ public partial class Form1 : Form { Thread thread1; static bool status = false; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (status) { status = false; thread1.Abort(); } else { status = true; thread1 = new Thread(test); thread1.Start(); } } static private void test() { MessageBox.Show("THREAD1 - running"); label1.Text = "test"; while (true) ; } }}