I would like to make an image viewer inn access 2000 and was wondering the bast way to go ahead. Would I be better designing a form with a microsoft imagelist control to hold the images and a microsoft listview control to view the images or is ther an easier way to display thumbnail images?
Depending upon what you really what to do...you don't necessarily need to reinvent the wheel to to it.
You can use the Microsoft Office FileDialog object to view all your images and make selections from it. The dialog can hold a full screen of thumbnail images if you size it to do so.
Place the following code into the OnClick event of a Command Button:
' Need 'Microsoft Office 10.0 Object Library' set in References
' for this to work. Place the code into the OnClick event of a
' Command Button or place it into a Function procedure.
On Error GoTo dlg_Error
Dim dlg As Object
Dim vrtSelectedItem As Variant
' 1 is the File Open Dialog - msoFileDialogOpen
' 2 is the File SaveAs Dialog - msoFileDialogSaveAs
' 3 is the File Browser (Picker) - msoFileDialogFilePicker
' 4 is the Folder Browser (Picker)- msoFileDialogFolderPicker
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
' Set the File Dialog Window Title
.Title = "Select A Photo For Further Processing..."
' Clear any File Dialog Filters
' Add a New File Dialog Filters. Filters don't apply to a Folder Dialog
.Filters.Add "Images", "*.bmp; *.gif; *.jpg; *.jpeg; *.wmf", 1
.Filters.Add "All files", "*.*"
' Set the Name for the action button in our File Dialog
.ButtonName = "Process Photo"
' Turn OFF File multi Select. We don't need this now.
.AllowMultiSelect = False
' Set the File Dialog window to show Thumbnamils
.InitialView = msoFileDialogViewThumbnail
' All Available Views:
' Set folder in which the File Dialog will start from.
.InitialFileName = CurDir
' If the Action button is selected and a file has indeed been
' selected then place the path & file name into the PhotoPath
' field on Form.
If .show = -1 And Not IsNull(.SelectedItems) Then
For Each vrtSelectedItem In .SelectedItems
' The TextBox on your Form named PhotoPath that may be
' bound to a table.
Me.PhotoPath = vrtSelectedItem
Set dlg = Nothing ' Free memory
Self Taught In ALL Environments.....And It Shows!