Hi Joan,
So I take it that your Draw method is being called, and that text is being placed on the canvas. So it's only a question of setting the selection colour and focus rectangle in the right place?
I think you will need to draw these yourself, at your required positions, in your draw method. The OnDrawItem event looks like this:
Code:
typedef void __fastcall (__closure *TDrawItemEvent)(Controls::TWinControl* Control, int Index, const Windows::TRect &Rect, TOwnerDrawState State);
Rect gives you the drawing rectangle area, AND State gives you the required state. It is a Set and can be a combination of the following:
dSelected The item is selected.
odGrayed The item should appear grayed.
odDisabled The item is disabled.
odChecked The item should appear checked. (This does not apply to all objects)
odFocused Keyboard input is directed to the item.
odDefault The item is the default item (This does not apply to all objects)
odHotLight The item is hot-lighted because under the mouse (only if the operating system supports hot-lighting)
odInactive The item and its associated menu are inactive (only under Windows 98 or later)
odNoAccel Any underline of an accelerator character should be skipped when drawing the control (only under Windows 2000 or later)
odNoFocusRect Do not display visual cues that indicate focus (only under Windows 2000 or later)
odReserved1 Not currently used.
odReserved2 Not currently used.
odComboBoxEdit The drawing takes place in the edit box of a combo box control.
It might also be worth taking a look at the OnMeasureItem event also.
Hope this helps.