this.Name = "Form1"; this.Text = "想说爱我不容易"; this.ResumeLayout(false);
} #endregion
/// /// 应用程序的主入口点。 /// [STAThread] static void Main() { Application.Run(new Form1()); }
private void noButton_Click(object sender, System.EventArgs e) { MessageBox.Show("Oh,Bye-bye!","I'm sorry",MessageBoxButtons.OK,MessageBoxIcon.Warning); this.Close(); }
private void yesButton_Click(object sender, System.EventArgs e) { MessageBox.Show("Thank you, I'm very happy!","Happy",MessageBoxButtons.OK,MessageBoxIcon.Information); } private void yesButton_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { Random rand = new Random(unchecked((int)DateTime.Now.Ticks)); int x=rand.Next(0,this.Size.Width-100); int y=rand.Next(0,this.Size.Height-50); Point point=new Point(x,y); yesButton.Location=point; }
} } |