Know the number of characters from the size of the vb6 listview column

Asked

Viewed 170 times

2

I have an api in vb6 responsible for generating reports from components of type listview. Turns out, the report is composed of a table with several columns that are mirrored in Listview. The measure of the column in the report is given by the number of characters it contains... example:

Column2 = Column2 has a size of 7 characters maximum.

However, we give the report column size based on the size of the text displayed in the listview column. That is, if I reduce the size of the column there in listivew and the text becomes apparent as "Colu" instead of "Coluna2" then I want to send the new size "Colu" = 4 to my report.

But it is difficult to have this measure... as for example, I could know how many characters are being displayed inside that column in the listview? Whereas it has been resized by the user and may be cutting some text in half.

1 answer

1


You’ll have to use the windows API for via Sendmessage, question directly to Handle of Listview these measurements. VB6 does not natively have interfaces for these properties.

I had the same problem in a project, once I found the link or the code, put

Browser other questions tagged

You are not signed in. Login or sign up in order to post.