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.
- Create a new FireMonkey multi-device application.
- 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.
- Drop a TButton onto your form.
- Right-click on the button and select "Edit Default Style".
- Drag and drop TImage from the Object Inspector onto the buttonstyle layout in the Structure pane.
- Select Image1Style in the Structure pane.
- In the ObjectInspector, select MultiResBitmap and load your image file (e.g. battery.png) and set Margins.
- 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).
- Apply the changes and close the Style Designer by clicking on the "x" in the top right hand corner.
- Ensure that the StyleBook property for your form is set to StyleBook1.
- Select the button control on your form, and set StyleLookUp to buttonstyle_battery.
- 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:
- Opens a new FireMonkey Style Designer window in which you can modify the style for the component class. For example, if you right-clicked a button, you can modify the "buttonStyle" object (a default style for the TButton class).
Edit Custom Style:
- Opens a new FireMonkey Style Designer window in which you can modify the selected control style. For example, if you right-clicked a button, you can modify the "button1Style" object (a style for this button only).
Get More. Do More. Spend Less