Link to home
Start Free TrialLog in
Avatar of jason03
jason03

asked on

ListView/Imageview

I am trying to make an app that will display small "thumbnail" images for same size bitmaps in a common directory.  I am trying to use a listview and an imagelist to accomplish this with little success.  One problem is I can't get it to display all the images and when I do try to do it manually, it will diplay the filename for each file, but the bitmap it displays for every file is the first one I click on.  If I close the app and restart it, the first image I click on is the correct one, but all subsequent files display the bitmap image of the first one I clicked on.  Does anyone have any suggestions or sample code I could look at?  I would really appreciate it.
Jason
Avatar of cjm30305
cjm30305

I am posting 3 times.  Once to explain it, then I am going to post the form file, then the unit.  make sure you double click the selected directory twice to make sure it loads the files in the list box.  This is very crude, but does function properly.

Hope this helps.

Cheers.
object Form1: TForm1
  Left = 387
  Top = 227
  Width = 653
  Height = 371
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Image1: TImage
    Left = 280
    Top = 216
    Width = 105
    Height = 105
  end
  object ListView1: TListView
    Left = 216
    Top = 48
    Width = 250
    Height = 150
    Columns = <>
    TabOrder = 0
    ViewStyle = vsList
    OnClick = ListView1Click
  end
  object DirectoryListBox1: TDirectoryListBox
    Left = 8
    Top = 48
    Width = 201
    Height = 153
    ItemHeight = 16
    TabOrder = 1
    OnDblClick = DirectoryListBox1DblClick
  end
  object DriveComboBox1: TDriveComboBox
    Left = 8
    Top = 208
    Width = 201
    Height = 19
    TabOrder = 2
    OnChange = DriveComboBox1Change
  end
  object FileListBox1: TFileListBox
    Left = 472
    Top = 48
    Width = 97
    Height = 17
    ItemHeight = 13
    Mask = '*.bmp'
    TabOrder = 3
    Visible = False
  end
end
ASKER CERTIFIED SOLUTION
Avatar of cjm30305
cjm30305

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
jason03:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept cjm30305's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

kacor
EE Cleanup Volunteer