Handling Control Events

Add controls to a Windows form.

  • Set properties on controls.

  • Load controls dynamically.

  • Write code to handle control events and add the code to a control.

Event handling for a control is very similar to event handling for a Windows form (refer to Chapter 1). Each control inherits a number of events from the System.Windows.Forms.Control class.

Each control type also has a set of events that is specific to its unique functionality. Every control has a default event associated with it (for example, the Click event for a Button control, Load for a Form control, and CheckedChanged for a CheckBox control). When you double-click a control in the Windows Forms Designer, the designer automatically creates an event handler for the default ...

Get MCAD/MCSD.NET Training Guide (Exam 70-316): Developing and Implementing Windows®-Based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.