Page 1 of 1

TListBox.Style parameter prevents from accepting

PostPosted: Thu Sep 27, 2012 12:07 am
by larschris
Delphi 7 with DropMaster 1.5, DMTextTarget. AcceptorControl is a TListBox.

I need to do some painting inside the ListBox and therefore put ListBox1.Style:=lbOwnerDrawFixed. But this causes the listbox to stop accepting files.

Any solutions to this behaviour? Thanks / larschris

Re: TListBox.Style parameter prevents from accepting

PostPosted: Fri Sep 28, 2012 5:51 am
by DropMaster
Did you do this at runtime? That would cause the window handle to be recreated which would invalidate the drag and drop. Try this. In your FormCreate event, put:

myListBox.Style := lbOwnerDrawFixed; // Or set it at design time

DMTextTarget1.AcceptorControl := nil; // disconnect drag-and-drop
DMTexTTarget1.AcceptorControl := myListBox; // reconnect drag-and-drop

Hope this helps.

Re: TListBox.Style parameter prevents from accepting

PostPosted: Mon Oct 01, 2012 4:36 am
by larschris
Thank you very much - it did the trick / Best regards