TabControl Dynamic Display TabPage in C # WinForm

Source: Internet
Author: User

In the WinForm application, TabControl is a good control that can provide multiple tabs (TabPages) on demand, but one problem is that when a project requires multiple tabs, but different feature requirements show different tabs, other non-functional tabs do not appear, The TabPage does not have a visible property. We can do this in a different way:

1. The dynamic Add/delete (move) TabPage during WinForm operation increases the time spent, and the controls and information on the TabPage are processed dynamically;

2.tapage is actually a TabControl child control, then we can use its. Parent property to handle all TabPage additions (add) in the WinForm framework, in the WinForm run, with the selected function, the tab that needs to be displayed Tabpage_x.parent = this.tabcontrol_x, does not need to display the tab tabpage_x.parent = NULL;

Ps:tabpage_x refers to the TabPage control name, tabpage_x refers to the TabControl's space name.

TabControl Dynamic Display TabPage in C # WinForm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.