Auto sizing column in TVirtualStringTree

时间秒杀一切 提交于 2019-12-07 03:14:46

问题


Climbing the learning mountain of TVirtualTreeView, I'm attempting to create a custom descendant that ensures that, when the control is resized, the width of the last column exactly fills control's width without requiring a horizontal scroll bar.

I see a number of items (a method and a number of events) pertaining to "AutoFitColumns", but not documentation covering this feature. Can I use AutoFitColumns to automatically resize my last column and if so, how.


回答1:


With your virtualtreeview, and a couple headers visible....

Select the "virtualtreeview | Header" in the delphi object inspector and Set the AutoSizeIndex to the the index of your last column.

Now select "virtualtreeview | Header | Options" and make sure hoAutoResize is TRUE.

hope this helps



来源:https://stackoverflow.com/questions/2679862/auto-sizing-column-in-tvirtualstringtree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!