Board index » cppbuilder » Multi line item in a list View ?

Multi line item in a list View ?

Hi,

Is it possible to display multi line items caption in a list view (STYLE
= vsReport).
I'd like to word wrap caption text in order to display the whole text
even if the column width is too small

Thank you.

 

Re:Multi line item in a list View ?


You can use the OnCustomDrawItem and/or OnCustomDrawSubItem event (depending
on your needs) to call the Win32 API function DrawText(), which will allow
you to draw word-wrapped text.

The only problem, though, is that list items have a fixed height, so you
can't adjust it on a per-item bases when needed for displaying multiple
lines of text.

Gambit

"Norbert Lingot" <"il faut rpondre"@au.newsgroup> wrote in message
news:3C91F118.CD593159@au.newsgroup...

Quote
> Is it possible to display multi line items caption in a list view (STYLE
> = vsReport).
> I'd like to word wrap caption text in order to display the whole text
> even if the column width is too small

Re:Multi line item in a list View ?


Quote
> The only problem, though, is that list items have a fixed height, so you
> can't adjust it on a per-item bases when needed for displaying multiple
> lines of text.

Is there any workaround for this??? Other than drawing by myself the entire
component....

Regards,

Rodrigo Gmez

Re:Multi line item in a list View ?


No.  The height is controlled by the OS, not the VCL.

You could try using TListBox instead, as it has an OnMeasureItem event for
this purpose.  However, then you lose virtual support for mass amounts of
data (if you're using that feature, that is).

Gambit

Quote
"Rodrigo Gmez" <rgomezREM...@ags.ciateq.mx> wrote in message

news:3c9280c5_2@dnews...

Quote
> Is there any workaround for this??? Other than drawing by myself the
entire
> component....

Other Threads