Calling Methods

Calling a method is fairly simple. However, just as methods that return values are declared differently from methods that don't, calling these two types of methods differs as well. You're first going to write code to call the two methods you declared as void (methods that don't return values). Double-click the Draw Ellipse button to access its Click event and take a look at the event declaration:

private void btnDrawEllipse_Click(object sender, System.EventArgs e)

As you might have noticed, event handlers are methods. The only real difference is that event methods are called automatically in response to the user doing something, rather than being called by code you write. In this case, the btnDrawEllipse_Click() event is ...

Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.