Hour 5. Building Forms—Part I

With few exceptions, forms are the cornerstone of every Windows application's interface. Forms are essentially windows and the two terms are often used interchangeably. More accurately, “window” refers to what's seen by the user and what the user interacts with, whereas “form” refers to what you see when you design. Forms let users view and enter information in a program (such as the form you built in your Picture Viewer program in Hour 1, “A C# Programming Tour”). Such information may be text, pictures, graphs—almost anything that can be viewed onscreen. Understanding how to design forms correctly will enable you to begin creating solid interface foundations for your programs.

C# uses a new forms engine called Windows Forms.


Think of a form as a canvas on which you build your program's interface. On this canvas, you can print text, draw shapes, and place controls with which users can interact. The wonderful thing about C# forms is that they behave like a dynamic canvas; not only can you adjust the appearance of a form by manipulating what's on it, you can also manipulate specific properties of the form itself.

In previous hours, you manipulated the following form appearance properties:

  • Text

  • Height

  • Left

  • Top

  • Width

The capability to tailor your forms, however, goes far beyond these simple manipulations.

There is so much to cover about Windows Forms that I've broken the material into two hours. In this hour, you'll learn the very basics of forms—adding them to a project, manipulating their properties, and showing and hiding them using C# code. Although you've done some of these things in previous hours, here you'll learn the nuts and bolts of the tasks you've performed. In the following hour, you'll learn more advanced form techniques.

The highlights of this hour include the following:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.104.183