Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Custom buttons and the integrated Style Designer

Author: Jorge Batista

With the integrated Style Designer in RAD Studio Berlin, you can quickly create custom image buttons. For creating entire multi-device styles from scratch, we recommend you use the Bitmap Style Designer, available via the Tools menu.

  1. Create a new FireMonkey multi-device application.
  2. Select a “Style” from the drop-down menu in the FireUI Designer. This will allow you to create a custom style for that platform. You can also change the platform in the Style Designer later.
  3. Drop a TButton onto your form.
  4. Right-click on the button and select “Edit Default Style“.
  5. Drag and drop TImage from the Object Inspector onto the buttonstyle layout in the Structure pane.
  6. Select Image1Style in the Structure pane.
  7. In the ObjectInspector, select MultiResBitmap and load your image file (e.g. battery.png) and set Margins.
  8. Select “buttonstyle” in the Structure Pane, then change the name in the Object Inspector to make the style easily identifiable in the list of style elements (e.g. buttonstyle_battery).
  9. Apply the changes and close the Style Designer by clicking on the “x” in the top right hand corner.
  10. Ensure that the StyleBook property for your form is set to StyleBook1.
  11. Select the button control on your form, and set StyleLookUp to buttonstyle_battery.
  12. Repeat the steps to create a custom button style for each platform.

 

 

When right-clicking on a FireMonkey control, you see two different style related options:

Edit Default Style:

Edit Custom Style:


 

Special Offers

Get More. Do More. Spend Less

Six Great Offers for the Holiday Season. Get RAD Studio Berlin today!

 

Exit mobile version