By now you should be comfortable with the very basics of windows programming. Below is a summary of some of the concepts covered in this section.
Programs in windows have a Graphical User Interface (GUI), which can be seen in use in any windows program.
Open the Code Editor window by right-clicking on the design view and selecting View Code, alternatively you can use the keyboard short cut F7 or select Code from the View menu.
The code for a Form is split in two files. For instance a Form named Form1 will be split between Form1.cs and Form1.Designer.cs.
A new Windows Forms application also has a Program.cs file just like a console application. This file contains the Main method that runs the form.
To run the application choose Start Debugging from the Debug menu, or use the short cut key F5, or click on the green arrow in the tool bar.
Controls appear as items on the form.
An event enables a class or object to notify other classes or objects when something of interest occurs.
A MessageBox can be used to display a message to the user.
Components have no visible part that can be seen within a form; instead they can be seen in the component tray of the design view of the IDE.
In order to redraw the screen after a timer event, we call the Invalidate() method of the Form class.
| Term |
Description |
| Click event |
Default event that is fired when an object is clicked. |
| Component |
Object that can be used in a form that has no visible part that be seen on the form. |
| Control |
Object that can be used in a form that has a visible part that be seen on the form. |
| Delegate |
A class that can hold a reference to a method. |
| Dispose |
Method where you dispose of managed and unmanaged resources used by the form. |
| F5 |
Keyboard short cut used to run an application in debug mode. |
| F6 |
Keyboard short cut used to build a solution. |
| F7 |
Keyboard short cut used to open the Code Editor window. |
| Graphical User Interface |
Graphics objects drawn on the screen that the user can interact with. |
| GUI |
See Graphical User Interface |
| InitializeComponent |
Method where the controls and components are actually instantiated (with the new keyword) and their properties are initialized. |
| Invalidate |
Method used to cause the form to be redrawn. |
| MessageBox |
Object that can be used to display a message to the user. |
| Publisher |
The class that sends (or raises) an event. |
| Single Threaded Appartment Thread |
There is only one thread which will accomplish all of the tasks for the application. |
| STAThread |
See Single Threaded Appartment Thread. |
| Subscriber |
The class(es) that receive (or handle) an event. |
| Title bar |
Top part of the Form that displays text. |