Obtaining TabPages From TabControl In C#
• TabControls are very handy to view information to number of panels. TabPages is made dynamically and use TabPageCollection class to maintain record of all TabPages.
Put a TabControl on a form. TabControl will have 2 original TabPages. Put a button control on form and Press that button.
• In Button event copy paste following.
TabControl.TabPageCollection TabCollection = tabControl1.TabPages;
foreach (TabPage Page in TabCollection)
{
MessageBox.Show(Page.Text);
}
• Run project. Press button, a box will come up with text of tab.



Reply With Quote
Copyright Techfuels
Bookmarks