Good day Fellow SO users,
I hope you can help me with my problem.
I've got a VB.NET application, with ListView for SerialNumbers.
The length of SerialNumbers are different from each other.
Users need to check for accuracy, and it's tedious for them to hover on each SerialNumber to check. Image below is the ListView without resizing.
After some research and testing, I've come up with resizing code
For i = 250000 To 250100 'Loop for filling dummy serial numbers
Dim sn As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" & i 'Dummy long Serial Number
lvSerial.Items.Add(New ListViewItem(sn, Group)) 'Add the dummy SN to the list
lvSerial.TileSize = New System.Drawing.Size(sn.Length * 8, 20) 'Resize the ListViewItem with length based on sn length * 8, height is fixed 20
Next i
For i = 100 To 200
Dim sn As String = "ABC" & i 'Dummy short serial number
lvSerial.Items.Add(New ListViewItem(sn, Group))
Next i
and I got this..
My problem is, for the short serial numbers, it consumes too much rows because it took the length of the long one.
It seems that TileSize applies for all ListViewItem and not individually.
Is there any way to make my ListViewItem be 'autosized' or 'autofit'?
Thanks in advance.