Board index » cppbuilder » TListView columns don't appear if not refreshed

TListView columns don't appear if not refreshed

Hi All,

 BCB4 +P1 & P2, W98SE.

I have that component housed in a TPanel. When the form that contains it

shows, its columns don't appear.
If the mouse flies on it, it changes to the resize pointer.
As soon as they're resised the appear as normal.

Is it normal ?

Thanks

Joachim

 

Re:TListView columns don't appear if not refreshed


Hi Joachim,

Quote
> I have that component [TListView] housed in a TPanel. When the form that
> contains it shows, its columns don't appear.  If the mouse flies on it,
> it changes to the resize pointer.

You can manipulate the size of each column via the TListColumn::Width property,
for example...

    TListColumns *Columns = ListView1->Columns;
    int count = Columns->Count;
    for (int index = 0; index < count; ++index)
    {
        Columns->Items[index]->Width = some_width;
    }

Alternatively, you can specify -1 to the Width property to have the header
section size to the longest item in the column, or -2 to have the header section
size to the column test.  You can also so this at design-time via the features
of the ListColumns Property Editor.

Good luck!

--
Damon Chandler
http://bcbcaq.freeservers.com

Other Threads