Tony
Tony

Reputation: 271

How to hide a specific column in a virtual string tree?

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?

Upvotes: 3

Views: 2603

Answers (1)

Max Williams
Max Williams

Reputation: 821

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.

Upvotes: 12

Related Questions