Comment : ajouter un contrôle à une page d'onglet
Mise à jour : novembre 2007
Vous pouvez utiliser le TabControl Windows Forms pour afficher d'autres contrôles au sein d'une structure organisée. La procédure suivante montre comment afficher une image dans la partie principale d'une page d'onglet. Pour plus d'informations sur l'ajout d'une icône à la partie d'étiquette d'une page d'onglets, consultez Comment : modifier l'apparence du contrôle TabControl Windows Forms.
Pour ajouter un contrôle par programme
Utilisez la méthode Add de la collection retournée par la propriété Controls de TabPage :
' Assuming that TabControl1 exists and has at least one tab page ' Add a button to the first tab page TabPage1.Controls.Add(New Button())
// Assuming that tabControl1 exists and has at least one tab page // Add a button to the first tab page tabPage1.Controls.Add(new Button());
// Assuming that tabControl1 exists and has at least one tab page // Add a button to the first tab page tabPage1.get_Controls().Add(new Button());
// Assuming that tabControl1 exists and has at least one tab page // Add a button to the first tab page tabPage1->Controls->Add(gcnew Button());
Voir aussi
Tâches
Comment : modifier l'apparence du contrôle TabControl Windows Forms
Comment : désactiver les pages d'onglets
Comment : ajouter et supprimer des onglets avec le contrôle TabControl Windows Forms
Référence
Vue d'ensemble du contrôle TabControl (Windows Forms)