How to add new Tab Button Dynamically

I want to add new tabs dynamically on click of new tab button and as a result a Window will open and i write tab caption

I had idea, but don’t know if this approach is the best one.

using combination of TabSheet + Button.

  1. define 1 horizontal/vertical layout as container, set the style posisition : relative
  2. add the tab to the containter
  3. add the button on container, set position : abosolute, set top and left as required ( using calculation of tab caption width * number of tab for left position)
  4. when button is click, just add new tab, and move the position of the button