Page 1 of 1

MultiColumnList ,ListHeaderSegment,colours question

Posted: Mon Jul 17, 2006 06:52
by Ken
how to change the text colour of ListHeaderSegment of MultiColumnList .

it seems there is no property for change it.

anyone have any suggestion?

sorry for my poor english

:?:

Posted: Mon Jul 17, 2006 19:24
by CrazyEddie
You should be able to do this by adding a PropertyDefinition to the ListHeaderSegment component in the looknfeel, and then referencing that as a ColourProperty in the Section specifications for the label.

So, at the top of the WidgetLook you would add something like:

Code: Select all

<PropertyDefinition name="LabelTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />


Then further down, in the StateImagery specifications, where you see the 'label' section specified, change those to something like:

Code: Select all

<Section section="label">
        <ColourProperty name="LabelTextColour" />
</Section>


This attaches the defined property to the rendering of the 'label' section and whatever colour is set in the property will be used for rendering the label. The ColourProperty could alternatively be specified in the ImagerySection for 'label', though the approach shown is more flexible (you could have multiple colours for the various different states this way).

Unfortunately ou can't access this propery from the layout files, due to a limitation of the way that columns are expressed at present. However, you can set it in code via the usual 'setProperty' member for Window.

HTH

CE.