Jump to content
softtouch

VirtualStringTree image alignment in cell

Recommended Posts

I use virtualstringtree in report mode (like a grid).

I need to have a column where no text is in the cells, but instead an image. That image need to be centered in the cell.

Setting the image index in the onGetImageIndex will display the image, but always left aligned.

Does anybody know how to center align that image or is that not possible with the virtualtreeview?

Share this post


Link to post

Custom drawing is indeed the way to go. You can use TVirtualStringTree.OnBeforeItemPaint event to do your custom drawing.

Share this post


Link to post

Alright, so it will be a custom draw solution. I thought it will, but wanted to be sure. Could be that there are some properties I could not find.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×