Highlighted
Absent Member.
Absent Member.
1166 views

Making tabcontrols 'visible' or 'invisible'

Jump to solution

I have a tab control called EmployeeMaint.

Contained within are several individual tab pages.

I wish to be able to manipulate the pages so that depending on some data item (WS-COMP-ID) various 'pages' are either visible or not when the tab control displays for the first time.

eg. if ws-comp-id = 'fred'

      make tabpage 'fred1' invisible

     else

     if ws-comp-id = 'joe'

    make tabpage 'joe1' invisible

    end-if.

Whats the code to do this?

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Making tabcontrols 'visible' or 'invisible'

Jump to solution

Each of the tabPages are actually separate controls that make up the tabPage Collection on the main tabControl.

You can change the properties of these pages individually, including their names by clicking on them in the designer or in the properties for the tabControl itself you can click on the tabPages collection.

There are several ways of removing and inserting these tabPages dynamically at run-time.

following will remove the tabPage named tabPage2 from the collection

         invoke tabControl1::TabPages::Remove(tabPage2)

following will insert the tabPage named tabPage2 back into the collection at index 1 (2nd position)

          invoke tabControl1::TabPages::Insert(1, tabPage2)

View solution in original post

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Making tabcontrols 'visible' or 'invisible'

Jump to solution

Each of the tabPages are actually separate controls that make up the tabPage Collection on the main tabControl.

You can change the properties of these pages individually, including their names by clicking on them in the designer or in the properties for the tabControl itself you can click on the tabPages collection.

There are several ways of removing and inserting these tabPages dynamically at run-time.

following will remove the tabPage named tabPage2 from the collection

         invoke tabControl1::TabPages::Remove(tabPage2)

following will insert the tabPage named tabPage2 back into the collection at index 1 (2nd position)

          invoke tabControl1::TabPages::Insert(1, tabPage2)

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.