2
votes

Trying to get a new style on a ComboBox in FireMonkey (XE2). But for some odd reason I cannot get the text of a ListBoxItem to show.

What I've tried is the following.

Create a new FireMonkey HD Application.
On the form I've added a ComboBox.
Right click on the ComboBox and select 'Edit custom style'

There I've added the following components

my own combobox - sub components

while the original one consist out of the following components

Original combobox - sub components

Now it seems to me that I need the TContent object (but I can't seem to find it in the toolpallete) How can i bind my Text object to the strings that are placed in my ComboBox?

Any pointers are very welcome.

1

1 Answers

2
votes

FireMonkey doesn't use a TText object to display the text. Instead it creates a copy of the list box item within the TContent (if I remember correctly).

As you've worked out you need to add a TContent to your form. The easy way to do this is to

  • go back to the form,

  • right click and select View as Text

  • Find the TStyleBook object and add a TContent at the appropriate point (the format for this should be obvious from the rest of the file).

  • No need to add any properties - defaults will be used the first time.

  • Right click, View as Form.

  • Go back into the style editor and edit away.