PostHeaderIcon Diff styles on Button in C++ Builder

The official website has already described about this theme, I just do several examples.

background color of the Button

find the property StyleLookup, and choose buttonstyle as it’s value.
Now we can find TintColor in the properties, this is background color.

Image of the Button

To place an image over a button:

  • With a TButton and TImage component on the Form Designer, make TImage a child component of TButton. (Use the Structure View.)
  • In the Object Inspector, select TImage and set its Align property to Client.
  • In the Structure View, select the button, expand the Image node, and then click 0 – Empty (1.000).
  • In the Object Inspector, click the ellipsis button (…) next to Bitmap.
  • Add your custom image in the MultiResBitmap Editor.
  • In the Object Inspector, select TButton, and do the following:
  • Clear the Text property.
  • Set the Height and Width properties of TButton to the actual height and width of your image.

Create a Segmented Control with Buttons

We use a SpeedButton component to define the Segmented Control, which gives users the ability to select one value from several options.

To define a Segmented Control, use the following steps:

  • Place three TSpeedButton components from the Tool Palette. Place the TSpeedButton components next to each other using your mouse;
  • Select the first component, and change its StyleLookup property to segmentedbuttonleft;
  • Select the second component, and change its StyleLookup property to segmentedbuttonmiddle;
  • Select the third component, and change its StyleLookup property to segmentedbuttonright. Now all three buttons look like a Segmented Control;
  • Select each component, and change the Text property as you like;
  • Use the mouse to select these three buttons;
  • Set the GroupName property to a unique name such as “Wechat”;
  • To specify that one of these components is to appear as Pressed by default, set the IsPressed property for one component to True.

Create a Toolbar Control with Buttons

We can define a Segmented Control on a toolbar; this is also known as a Scope Bar, a segmented control that can be used to control the scope of a search.
Use the same TSpeedButton controls as in the previous steps, but with the following values for the StyleLookup property (only available on iOS target platform):

  • toolbuttonleft
  • toolbuttonmiddle
  • toolbuttonright

(on the Android target platform set StyleLookup as toolbutton for each of the buttons.)


Leave a Reply

Your email address will not be published. Required fields are marked *



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2010 - C++ Technology. All Rights Reserved.

Powered by Jerry | Free Space Provided by