日期:2014-05-16 浏览次数:20866 次
public partial class Main : Form
{
public static string event_str = "";
AlarmForm alarmForm;
private void alarm_timer_Tick(object sender, EventArgs e)
{
//这里有个判断就不写了
alarmForm = new alarmForm();
alarmForm.Show();
}
}
public partial class AlarmForm : Form
{
private void alarmForm_Load(object sender, EventArgs e)
{
event_label.Text = Main.event_str; //主要想问:为啥可以直接访问Main的成员?
}
}
//alarmForm.designer里有这句
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.alarmForm_Load);
}