SpaceTag

 

We all want to have good looking Gui's and the Space tag helps us to achieve that by enabling us to have a desired space between controls. Not only does the space tag allows us to have a space between controls but it may also be used to draw line or rectangles on the form if the BackColor attribute is set to something.

 SpaceTag has the following attributes:

       Height = M, Width = M, BackColor = C, halign = A, and valign = V.

BackColor can be a color of the rectangle being constructed. To see the full description of these attributes click here.

 

                                                                                                  

Examples of SpaceTag

The next Examples shows how we can use the space tag to separate controls and to draw a rectangle.  note that the Orange and Green buttons are separated by 5 points/pixels.

Example 3.4.1: Source

@"<Form Text= 'Search Student'>
<Vertical>
   <Horizontal>
      <Button Name = Orange/>
        <Space Width = 5/>
      <Button Name = Green/>
   </Horizontal>
  <Space Height = 5/>
 <Space Width = 3in Height = 2in BackColor = Orange/>

</Vertical>
</Form>";

This code will generate the image below. 

 

 

 

Note:  the measurements are given in "points" (which are taken to be identical to pixels), unless specified.

 

<<PREVIOUS   NEXT >>