Adding Controls to Forms

Within the Visual Studio .NET Forms Designer, controls can be placed on the surface of any container object, such as Windows Forms, or controls such as Panel, GroupBox, or TabControl. You also can add controls to a form programmatically.

When creating controls programmatically, you must remember to associate them with a parent container control. If you don't do this, controls will be created but not displayed.

Adding Controls with the Windows Forms Designer

Within the Forms Designer interface, you can drag and drop controls from the toolbox or using the View menu. Figure 2.10 shows this toolbox.

Figure 2.10. Controls toolbox. ...

Get Developing and Implementing Windows®-Based Applications with Visual C#™ .NET and Visual Studio® .NET Exam Cram™ 2 (Exam 70-316) 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.