|
By default, after adding a new tab control to a form, it is equipped with two property pages. Before manipulating a tab control, there are details you should keep in mind. In the programming world, we consider that a tab control is actually made of two objects presented as one. A tab sheet, also called a property sheet is like the desk of a table. If you listened to your teacher in primary or elementary school, you probably heard her saying over and over that you should/must not write on the desk of a table. This is also true here. In real life, every on a table is positioned on that table, like pieces of paper. On a tab sheet, the tab controls, also called property pages, are positioned on the tab sheet (in Microsoft Access, you cannot access the tab sheet, meaning you cannot place anything on it; in some programming environments, like Microsoft Visual C++, you can certainly access the property sheet). This discussion is intended to show you that there is a separation between the tab control and the area on which it lies. This makes it possible to move all tab controls with one movement.
The tab sheet is a rectangle that surrounds the tab controls and holds them as their parent. To tab sheet is represented by the area on the right side of the tabs. To select that tab sheet, you can click that area:
When the tab sheet is selected, you can see that its Name in the Properties window starts with TabCtlX. If you select the tab sheet and move it, the tab controls, also called property pages, on it would move also. If you delete the tab sheet, its property pages would be deleted also. For this reason, the tab sheet is considered their parent.
As mentioned already, the tab controls you use are actually positioned on a tab sheet. Each tab control or property page is considered on its own and its only relationship with the other tabs is that they belong to the same sheet. Based on this, each tab can be accessed separately. To manipulate the properties of a tab page, you should select it first. To do that, click its label (not necessarily its body).
By default, after adding a new tab control to a form, it is equipped with two tab pages. To add a new tab, you can right-click one of the tabs or the area of the tab sheet and click Insert Page. To remove a tab page, you can click its tab and press Delete. Alternatively, you can right-click a tab and click Delete Page.
We stated that a tab control (property page) acts as a parent for other controls positioned on it. Based on its role, it should indicate its role. This is specified by its button, which displays a caption. Therefore, after adding a tab control, one of the first actions you probably should take is to specify its role. This is role by changing the value of its Caption in the Properties window.
After you have typed a string for the Caption of a tab, its width is adjusted to accommodate its string. This is done for each tab. Consequently, one tab with a Resume Caption and another tab with Personal Information, as Caption, would have different widths. Alternatively, you can give the same width to all tabs regardless of their different lengths of strings. In this case, a tab with Resume and another with Personal Information labels would have the same width. To give the same width to the tabs, in the Format tab of the Properties window of the tab control (the property sheet itself), change the value of the Tab Fixed Width. The default value of 0” means that you let Microsoft Access determines the necessary width to contain the label on the tab. You can then change the value as you wish. In the same way, the Tab Fixed Height can be used to control the height of the tabs or buttons.
You can display either or both a picture and a label on the tab. Although picture can be any size, you should limit it to 16x16 pixels. To add a picture to the button, select the tab. In the Properties window, click the Picture property and click its ellipsis button. Locate and select a picture. It should be a bitmap (with bmp extension) or an icon (with ico extension).
By default, property pages display their labels on a tab. If you do not like the tab, you can use either a button or nothing. This property is called by the Style field in the Properties window of the tab sheet. Like the Tabs value, the Buttons property allows each property page to display a label that indicates its role. If you set the Style property to None, the property sheet would appear as a simple rectangular box and the user would not be able to change the pages. Therefore, if you decide to use this option, unless you want to hide the other pages, make sure you provide the user with the means of switching to a difference property page.
Based on the role of the tab sheet, some properties of the tab sheet are also imposed on the tab pages. For example, on the Properties window, if you change the value of the Top or the Left properties, the tab sheet moves and at the same time, the corresponding values of the tab pages are changed.
|