Arne Garvander <(E-Mail Removed)> wrote:
> How do I set an event handler in C#?
> The code below does not seem to fire.
> private void Form1_Load(object sender, System.EventArgs e)
> {
> int i = 1;
> }
You need to subscribe to the event, e.g.
Load += Form1_Load;
(in the constructor, for example). In the designer, you can click on
the lightning bolt to make it hook up the events for you.
--
Jon Skeet - <(E-Mail Removed)>
Web site:
http://www.pobox.com/~skeet
Blog:
http://www.msmvps.com/jon.skeet
C# in Depth:
http://csharpindepth.com