cyotek / imagelistview

Automatically exported from code.google.com/p/imagelistview
5 stars 0 forks source link

Get FileSize #137

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
 Dear Sir:
   i am using this below code to get the filesize value
     For Each _itmS As Manina.Windows.Forms.ImageListViewItem In LSI.Items
       If _itmS.Selected = True Then
             lblFileSize.Text = _itmS.FileSize.ToString
       End If
     Next
but result is[LONG] 4058742,...  not a string like 2.5MB , 69.5KB . 
So i use this below code to get that subitems value but error [Index was 
outside bounds of the array]
    For Each _itmS As Manina.Windows.Forms.ImageListViewItem In LSI.Items
       If _itmS.Selected = True Then
             lblFileSize.Text = _itmS.GetSubItemText(0).ToString
       End If
     Next

if view mode is Details then it will give the correct format in FileSize 
[3.2MB,69KB....]
how to get that value sir and how to get the SubItemsText value.

Thanks
Raj..

Original issue reported on code.google.com by meds...@gmail.com on 3 Aug 2011 at 2:07

GoogleCodeExporter commented 9 years ago
You can use the FormatSize function in the utility class.

Manina.Windows.Forms.Utility.FormatSize(2560); // Returns 2.5KB

Original comment by oozcitak on 8 Aug 2011 at 10:14