1

I'm setting the icon in a Virtual Treeview in its OnGetImageIndex event. It works, but the icon is positioned directly at the left edge of the node (x=0). I'd like to move it a little bit to the right, but I can't find any way to do this.

An alternative would be to draw the icon manually, but I'm wondering if there's an easy way to position the icon that I'm overseeing.

Mike Torrettinni
  • 1,816
  • 2
  • 17
  • 47
CodeX
  • 717
  • 7
  • 23
  • 1
    Please attach a screenshot. What size does the icon have (without whitespace / transparent parts) and what size does the imagelist have, in which it is? If you increase the imagelist width and move the icon to the right, this will have the desired effect. There is a TextMargin property to achieve something similar for the text, but there is unfortunately no ImageMargin property. – Joachim Marder May 12 '16 at 06:14
  • Thanks for your reply. I understand that chaning the image itself or the imagelist would be a workaround. But I rather use OnAfterCellPaint and paint the image myself than altering the imagelist. In my understanding VTV is very well thought through so for most cases there's a proper solution. That's why I'm so confused that I can't find a proper way to position an image that VTV paints for me. If there's no dedicated attribute for the position, I thought there might be some way to shrink the node area itself before something is drawn there. – CodeX May 13 '16 at 23:04

0 Answers0