Visual Graph Getting Started - Make Graphic Button

Now, we explain how to make a graphic button like below, left picture is not pressed, right is pressed.

Please follow these steps to make it.

1. Draw a pentagram by polygon basic element and set its background color as gray (change BackColor property), and then duplicate it, place the clone at its upper left as above, set clone's BackColor as red. At last, set red pentagram Left and Top properties as 10, and set gray one Left and Top properties as 16 both.

2. Select red pentagram, and then double-click OnLButtonDown event in the Functions view at left to write the follow script:

Sender.MoveBy( 16, 16 )

3. As above, write the following script in red pentagram's OnLButtonUp event:

Sender.MoveBy( -16, -16 )

4. Rename current sheet as StarButton (change its Name property).

5. Save current file as c:\libtest.tbl.

6. Select Libraries tab and click File -> Open library... menu item, choose libtest.tbl, now you can find StarButton element under libtest group in the Libraries view:

7. Create a new file and draw a StarButton on it, and then click Program ->Run menu item to test this button.