Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-add-a-control-to-a-tab-page.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

1.9 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Add a Control to a Tab Page 03/30/2017
csharp
vb
cpp
TabPage control
tab controls [Windows Forms], tab order
tab pages [Windows Forms], adding controls
b092532e-7346-469f-b9a1-897f9bea4fb7

How to: Add a Control to a Tab Page

You can use the Windows Forms xref:System.Windows.Forms.TabControl to display other controls in an organized fashion. The following procedure shows how to add a button to the first tab. For information about adding an icon to the label part of a tab page, see How to: Change the Appearance of the Windows Forms TabControl.

To add a control programmatically

  1. Use the xref:System.Windows.Forms.Control.ControlCollection.Add%2A method of the collection returned by the xref:System.Windows.Forms.Control.Controls%2A property of xref:System.Windows.Forms.TabPage:

    [!code-cppTabPageControlCollectionHowToAdd#1] [!code-csharpTabPageControlCollectionHowToAdd#1] [!code-vbTabPageControlCollectionHowToAdd#1]

See also