in a label i can add a new line like this
Label.Caption:='First line'+#13#10+'SecondLine';
can this be done in a TListView?
listItem:=listView.Items.Add;
listItem.Caption:='First line'+#13#10+'SecondLine';
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is possible to have multiline strings in a standard
TListViewinvsReportstyle, but AFAIK it doesn’t support varying row heights. However, if you have all rows with the same number of lines > 1 you can achieve that quite easily.You need to set the list view to
OwnerDrawmode, first so you can actually draw the multiline captions, and second to get a chance to increase the row height to the necessary value. This is done by handling theWM_MEASUREITEMmessage, which is sent only for owner-drawn list views.A small example to demonstrate this: