Wednesday, January 7, 2009 Tip of the Day: Converting Tab Control to Enhanced Tab Control Section: Form Designer Chapter: Enhanced Controls in Form Designer Supported Versions: R:BASE 7.5, 7.6, V-8, R:eXtreme 9.0 (64/32)
Did you know that you can convert any Tab Control and associated Tab Pages to Enhanced Tab Control along with Tab Pages while in Form Designer? Examples: -- Before: http://www.razzak.com/tips/TabToEnhacedTab_01.png -- After: http://www.razzak.com/tips/TabToEnhacedTab_08.png http://www.razzak.com/tips/TabToEnhacedTab_09.png http://www.razzak.com/tips/TabToEnhacedTab_10.png Here's how: 00. First, make a backup copy of the form in question ... 01. This is how a normal Tab Control and Tab Pages look at the runtime. A very simple demo ... Figure 1: http://www.razzak.com/tips/TabToEnhacedTab_01.png 02. While in Form Designer, click on the "Tab Control" panel (not the Tab Page), and then use the copy option [Ctrl+C] or right-click and select Copy option from the speed menu. Figure 2: http://www.razzak.com/tips/TabToEnhacedTab_02.png 03. Click on R:BASE Editor icon from the Main Window Toolbar and use the [Ctrl+V] keys to paste the text in editor. The text should look like this ... Figure 3: http://www.razzak.com/tips/TabToEnhacedTab_03.png 04. Very carefully, change the text on the first line from TPageControl to TRPageControl Note: We are only adding the "R" in the text. This will change the main form object from "Tab Control" to "Enhanced Tab Control" with all additional options. Figure 4a: http://www.razzak.com/tips/TabToEnhacedTab_04a.png 05. Now change each Tab Sheet (Tab Page) definition from "TTabSheet" to "TRzTabSheet" Note: We are only adding the "Rz" in the text. This will change the page object from "Tab Page" to "Enhanced Tab Page" with all additional features. Figure 4b: http://www.razzak.com/tips/TabToEnhacedTab_04b.png Repeat the same change from "TTabSheet" to "TRzTabSheet" for all tab pages accordingly. 06. Now highlight the entire text and use [Ctrl+C] to copy to clipboard. Figure 5: http://www.razzak.com/tips/TabToEnhacedTab_05.png 07. Switch back to the Form Designer and simply delete the existing Tab Control. Figure 6: http://www.razzak.com/tips/TabToEnhacedTab_06.png 08. Now paste [Ctrl+V] the contents (Step 06) from windows clipboard. Notice the Enhanced Tab Control and Pages ... Just like magic! Figure 7: http://www.razzak.com/tips/TabToEnhacedTab_07.png Change the Enhanced Tab width accordingly to saturate the enhanced tab pages. 09. Run the form and see how it looks ... Figure 8: http://www.razzak.com/tips/TabToEnhacedTab_08.png 10. You may even add your favorite theme, if you wish. Figure 9 and 10: http://www.razzak.com/tips/TabToEnhacedTab_09.png http://www.razzak.com/tips/TabToEnhacedTab_10.png That's all there is to it! Enjoy and make sure to have fun. Very Best R:egards, Razzak.

