C#??е???????
???????????? ???????[ 2014/8/15 10:50:43 ] ????????C# ??? .NET
??????У???????壬?????????????????飬????ν???????????дC#????????????C#????????????????????????????в?????ɡ?
????1??????????????У?
??????????? delegate ????????? ?????(????)
??????????????????????????????????????д??е?????????????????????д??
????delegate void set_Text(string s);//???????
????private void set_lableText(string s)
????{
????label1.Text = s;
????}
???????????????з??????????????з???????????д??????????????д????????
????2?????塢????????
????set_Text Set_Text; //???????
????Set_Text = new set_Text(set_lableText); //????????
?????????????????
????3????????????????У???????????????????????д??
private void button1_Click(object sender?? EventArgs e)
{
thread1 = new Thread(new ThreadStart(run));
thread1.Start();
}
private void run()
{
for (int i = 0; i < 101; i++)
{
label1.Invoke(Set_Text?? new object[] { i.ToString() }); //?????????У??????lable1???
Thread.Sleep(1000); //????????????λ??ms
}
}
???????????????£???д??????????????Щ???????!
?????????????????? label1.text=i.toString();?????label1.Invoke(Set_Text?? newobject[] { i.ToString() });
????????????label1??text??????????????????
??????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11