C# ?????????細??????????
?????unix8 ???????[ 2017/2/9 10:35:13 ] ????????C# ???????????
??????C#?????????????????????????????????????細?????????C#?и?????????С?
????Ч?????????????????壬FORM1????????“??form2”??button???????FORM2????????“???form1???“??button?????????????FORM1?е??button???“??form2””?FORM2????????????FORM2?е?“???form1???”??Form1????????
?????????Form2???棺
?????????????????к???????
????Form2????
????public delegate void ChangeFormColor(bool topmost);
????Form2????
????public event ChangeFormColor ChangeColor;
????Form2????????е??????
rivate void button1_Click(object sender?? EventArgs e)
{
ChangeColor(true);//?????????
}
??????????Form1???棺
????button???“??form2“??click???????????????
{
Form2 f = new Form2();
f.ChangeColor += new ChangeFormColor(f_ChangeColor);
f.Show();
}
f.ChangeColor += new ChangeFormColor(f_ChangeColor);
?????????????????+=?????????Tab????????????????????????????£?
void f_ChangeColor(bool topmost)
{
this.BackColor = Color.LightBlue;
this.Text = "?????";
}
????????????????
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ?細???????
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender?? EventArgs e)
{
Form2 f = new Form2();
f.ChangeColor += new ChangeFormColor(f_ChangeColor);
f.Show();
}
void f_ChangeColor(bool topmost)
{
this.BackColor = Color.LightBlue;
this.Text = "?????";
}
}
}
using System;
using System.Windows.Forms;
namespace ?細???????
{
public delegate void ChangeFormColor(bool topmost);
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
public event ChangeFormColor ChangeColor;
private void button1_Click(object sender?? EventArgs e)
{
ChangeColor(true);//?????????
}
}
}
???·???
??????????????????
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