Skip to Content
Windows Forms Programming in C#
book

Windows Forms Programming in C#

by Chris Sells
August 2003
Intermediate to advanced content levelIntermediate to advanced
736 pages
14h 48m
English
Addison-Wesley Professional
Content preview from Windows Forms Programming in C#

Child Controls

Unlike main and context menus, controls[8] dragged from the Toolbox onto the surface provided by the Designer are added to the form's Controls collection. You can use that collection yourself to add controls dynamically at run time (as I showed earlier in this chapter), or you can add arrays of controls the way the Designer-generated InitializeComponent does:

[8] Technically speaking, both MainMenu and ContextMenu are components, as are all the rest of the items that you can drag and drop from the Toolbox that show up on the tray along the bottom of the design surface. For a list of the standard WinForms components, see Appendix D: Standard WinForms Components and Controls.

void InitializeComponent() {
  this.SuspendLayout(); // ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Simple and Efficient Programming with C#: Skills to Build Applications with Visual Studio and .NET

Simple and Efficient Programming with C#: Skills to Build Applications with Visual Studio and .NET

Vaskaran Sarcar
Programming .NET Windows Applications

Programming .NET Windows Applications

Jesse Liberty, Dan Hurwitz
.NET Windows Forms in a Nutshell

.NET Windows Forms in a Nutshell

Ian Griffiths, Matthew Adams

Publisher Resources

ISBN: 0321116208Purchase book