コード例 #1
0
 private void listViewExplorer_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewExplorer))
     {
         ExplorerFileInfo file = (ExplorerFileInfo)this.listViewExplorer.SelectedItems[0].Tag;
         // 预览图上显示
         this.labelFileName.Text       = file.FileName;
         this.labelFileDatetime.Text   = "创建时间:" + file.CreateDateTime.ToString("yyyy-MM-dd HH:mm");
         this.labelFileSize.Text       = file.FileSize > 0 ? "文件大小:" + FileKit.FormatFileSize(file.FileSize) : "";
         this.pictureBoxFileIcon.Image = FileKit.GetFileIconImage(this.imageListLargeIcon, file);
     }
 }