Controls Overview

Controls are preprogrammed pieces of interface code
Controls are components that combine a graphical interface with functionality. They are reusable pieces of code designed to do a task.
All controls inherit from the base class called Control
You can resize a control by selecting is and dragging and edge or corner
Controls can be moved by selecting them and dragging them around in the form
Select multiple controls by holding the ctrl key down
Process of programming Windows
- Position a control- by dragging the from the toolbox to the form
- Change properties of a control
- Write code for a control
Create Project
Visual Studio creates the following folders when it creates a project:
- Reference Folder – holds parts of the Framework that you will use in this project
- Bin Folder – holds the finished program and any components
- Obj Folder – hold any resource specific to the application
- MyProject Folder –holds configuration files
Form
Rename the default form by right-clicking and select rename
Resize the form by clicking on the handle in the lower right corner and dragging it to a new position

Drag controls to the form
Controls are named by default using the control name and an incremental number
After you drag a control to the form it becomes an instance of the control

Control Events
Select a control
Loop at properties
Click lightning bolt button
You see possible events of that control
- Double click the event to generate a method to handle that event
- Or type a method name to handle that event
- Or click drop down arrow next to the event and choose event code for this event

Event handlers
Code to respond to event
Methods with a special signature
You can have one event handler respond to the same event on many different controls
