3

How can I hide specific columns in my virtual string tree?

I've tried this code:

Header.Columns.Items[3].Width := -1;

It displays the column, but not the header caption. Why?

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
Tony
  • 251
  • 3
  • 6
  • 13

1 Answers1

12

To hide a column, eliminate coVisible from the TVTColumnOption enumeration, e.g.,

if coVisible in VST.Header.Columns[3].Options then
  VST.Header.Columns[3].Options := VST.Header.Columns[3].Options - [coVisible];

The TVirtualTreeColumn class has a MinWidth property that would override any column width less than MinWidth. I'm not in a position right now to check this, but I don't think MinWidth will even accept a negative integer value.

Max Williams
  • 821
  • 1
  • 7
  • 13