In C# Load event

Author:Anonymous    Updated:2008-10-15 13:20:18

Load (load) the event occurs in time the Form window load, its establishment step is as follows. (1) opens VS2008, the newly built Windows window application procedure, and names is FormEventTest. (2) opens its Form1 the attribute window. (3) found the Load event item, then the double click entered this event code edition document Form1.cs, for its compilation following code. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace FormEventTest { public partial class Form1: Form { public Form1() { InitializeComponent(); } //definition window load event processing private void Form1_Load (object sender, EventArgs e) { MessageBox.Show (“Form Loaded!”); } } } the following code is the window load event's processing function. private void Form1_Load (object sender, EventArgs e) { MessageBox.Show (e.ToString()); MessageBox.Show (“Form Loaded!”); } parameter sender expression initiation event's object, here represents the Form1 window. Parameter e the data which contains on behalf of the event. Windows uses these two parameter guidance correct processing function. In which following sentence, MessageBox.Show (e.ToString()); its parameter e.ToString() expression returns current object System.String. (4) the operating procedure, may see the procedure when loads the window, will spring successively then two news prompt frame. This is above processing function in the sound should the news.

Previous:c # copy the realization of all folders and files code
Next:Prepared to expand the use of C # stored procedure
User Reviews
Site Search
Recommended article
AD