Determining What to Draw

From RAD Studio
Jump to: navigation, search

Go Up to Adding Graphic Capabilities


A graphic control can change its appearance to reflect a dynamic condition, including user input. A graphic control that always looks the same should probably not be a component at all. If you want a static image, you can import the image instead of using a control.

In general, the appearance of a graphic control depends on some combination of its properties. The gauge control, for example, has properties that determine its shape and orientation and whether it shows its progress numerically as well as graphically. Similarly, the shape control has a property that determines what kind of shape it should draw.

To give your control a property that determines the shape it draws, add a property called Shape. This requires

  1. Declaring the Property Type.
  2. Declaring the Property.
  3. Writing the Implementation Method.

Creating properties is explained in more detail in Creating properties.