Página 1 de 1

ListView

Publicado: Vie May 19, 2017 9:55 am
por Timm
Hi!

If a ListView control losts focus the background color of the selected item changes. It gets the same color as a not selected item.
Can I avoid this behavior?

Best regards

Timm

Re: ListView

Publicado: Vie May 19, 2017 12:12 pm
por ignacio
Hello Timm,

Try this trick:

- Set Listview:lShowSelAlways to .F.
- Add this event:

Código: Seleccionar todo

METHOD ListView1DrawCell( oSender, oItem, nColumn, nClrText, nClrPane, hDC, aRect ) CLASS TForm1

   LOCAL oFocusItem

   oFocusItem := ::oListView1:GetFocused()
   
   IF oFocusItem <> NIL .and. oItem == oFocusItem
      nClrText := CLR_HGREEN
      nClrPane := CLR_GREEN
      RETURN 1
   ENDIF

RETURN NIL
Regards,

Re: ListView

Publicado: Vie May 19, 2017 1:03 pm
por Timm
Hi Ignacio,

in Xailer 4 TListViewItem seems not to have the event OnDrawCell.
Is only part of Xailer 5, right? -> http://xailer.info/wordpress/en/?p=304

Could it be that Xailer 5 is already available and you just forgot to sent it to me? Just kidding... ;-)

Best regards

Timm