Hello Experts
I am allowing users to put thier own pictures on an image control of a form. They browse to the image, click it, and the image is stored in a folder and displayed on the image control. Works great! I would like for the default to be thumbnail rather than list. Can anyone help. I have no idea how to tie the two samples that I have identified or even if they will work together. I found ONE reference out on the web and sadly DH lost me in the process, and I am unable to bring the referance up again. Any takers out there.
I am currently using Ken Getz
Call Windows File Open/Save Dialog box found at
http://www.mvps.org/access/ ...
Recently located this little gem of Bryan Stafford.
Code found on
http://www.mvps.org/vbvision/grouped_demos.htm#Common_DialogsAttribute VB_Name = "MDialogHook"
Option Explicit
' demo project showing how to call the GetSaveFileName and GetOpenFileName API functions
' by Bryan Stafford of New Vision Software® - newvision@mvps.org
' this demo is released into the public domain "as is" without
' warranty or guaranty of any kind. In other words, use at
' your own risk.
' this demo also shows how the view type for the file list can be set before the
' dialog is shown by sending the undocumented windows messages discovered by Brad Martinez
' (
http://www.mvps.org/btmtz/index.html). THANKS Brad! you can find more information
' in Brad's listview demo on his site.
'*************************
**********
**********
**********
**********
******
' MESSAGES PROVIDED BY Brad Martinez
' view menu command IDs fall within the FCIDM_SHVIEWFIRST/LAST
' range defined in ShlObj.h:
Public Const FCIDM_SHVIEW_LARGEICON As Long = &H7029& ' 28713
Public Const FCIDM_SHVIEW_SMALLICON As Long = &H702A& ' 28714
Public Const FCIDM_SHVIEW_LIST As Long = &H702B& ' 28715
Public Const FCIDM_SHVIEW_REPORT As Long = &H702C& ' 28716
Public Const FCIDM_SHVIEW_THUMBNAIL As Long = &H702D& ' 28717
Public Const FCIDM_SHVIEW_TILE As Long = &H702E& ' 28718
'*************************
**********
**********
**********
**********
******
etc....
My code snipet... I am thinking that I need to call something on Bryan software, but I am really lost at trying to make them work together.
++++++++++++++++++++++++++
++++++++++
++++++++++
++++++++++
++++++++++
+++++++++
Dim strFileLocation As String
strFileLocation = CreateObject("WScript.Shel
l").Specia
lFolders("
Desktop") & "\Facilities\"
If "" & Dir(strFileLocation & strDocName) = "" Then
If Me.tglDelImage = -1 Then MsgBox "Please do NOT delete the default NO-PHOTO.JPG image. " _
& Chr(13) & Chr(13) & "Select Cancel to CANCEL if you have changed your mind"
Dim strFilter As String
Dim strInputFileName As String
Dim mystrFilter As String
strFilter = ahtAddFilterItem(strFilter
, "JPG Files (*.JPG)", "*.jpg")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY
)
If Len(strInputFileName) Then
FileCopy strInputFileName, strFileLocation & strDocName 'strInputFileName = image to be copied and saved selected from dialog
'Load the image to the screen and give positive feedback.
strLength = Len(strDocName)
char = Mid(strDocName, Len(strDocName) - 4, 1)
imgSeq = "img_" & char 'Set the location name
Me(imgSeq).Picture = strFileLocation & strDocName 'Yes, show match in Directory
Else
' user hit cancel...
End If
End if
++++++++++++++++++++++++++
++++++
Thank you.
Paul
Start Free Trial