Skip to content

Using the Control

Jack Siro edited this page Oct 16, 2020 · 4 revisions

To use the control

  1. Add the MdiTabCtrl to a form
  2. Dock the control in it
  3. Change all the properties through the designer.

To insert a TabPage (Form) in the control:

  Form cform; //Declare child Form
  cform = new ChildForm(); //call an instance of a class you want to show in a tab
  tabcount = tabcount + 1;
  cform.Text = "This is Tab " + tabcount; //Declare text for this tab
  TabControl1.TabPages.Add(cform);
  • You don't show the form, instead you just add it to the control. Very simple, isn't it? On an existing program, you just need to add the control to the main form, and where you have the Show call for the form, you just replace by the Add method.
Clone this wiki locally