// Create the account and subscribe the event handler. private void Form1_Load(object sender, EventArgs e) { // Create the account. TheAccount = new MoneyMarketAccount(); TheAccount.Balance = 100m; // Subscribe to the Overdrawn event. TheAccount.Overdrawn += OverdrawnHandler; // Display the account balance. DisplayBalance(); }
// Create the account and subscribe the event handler. private void Form1_Load(object sender, EventArgs e) { // Create the account. TheAccount = new MoneyMarketAccount(); TheAccount.Balance = 100m; // Subscribe to the Overdrawn event. TheAccount.Overdrawn += OverdrawnHandler; // Display the account balance. DisplayBalance(); }