Buttons

 

Although we have already spoken about buttons, this page provides advance examples to the ones we have already highlighted.

 

Views button has the following properties and the full description of these properties can be found here.

Name, Text, TextAlign, Image, Width, Height, ForeColor, BackColor, Font, halign and valign.

Examples below show how these properties can be used.

 

Examples of the Buttons

The next example shows how we can have buttons in different colors and different Fonts. Note that when the Text attribute is not provided, the Name of the Button will be displayed as the Text on a Button.

Example 2.8.1: Source

@"<Form Text= 'Holidays'>
<Horizontal>
  <Button Name = example Text = button1 BackColor = LightGreen ForeColor = Red/>
    <Button Name = button2 ForeColor = Red BackColor = Yellow Font = Bold10/>

</Horizontal>
</Form>";

The example above will generate the following image.                

                                                                                                               

The next one shows how we can have have images on the buttons. Note that you have to download the images below for this example to work on your PC.     

                                                                    

Example 2.8.2: Source                  

         Images

@"<Form Text= 'Holidays'>
<Horizontal>
 

  <  Button Name = up image = 'up.GIF' width = 5cm height = 3cm/>
   <Button Name = uv image = 'uv.GIF' width = 10cm height = 3cm/>
 

</Horizontal>
</Form>";

    

 

The example above will generate the following image.

                                                                                                         

<<PREVIOUS  NEXT >>