Re: saving control properties/names to text
you have to populate the .Tag property when you load the picture. this is what i was doing in my example prj:
VB Code:
picArr(Index).Picture = LoadPicture(cmdlg.FileName)
[B]picArr(Index).Tag = [/B]Mid$(cmdlg.FileName, InStrRev(cmdlg.FileName, "\") + 1) 'could have used cmdlg.FileTitle but forgot
FileCopy cmdlg.FileName, App.Path & "\Temp\" & picArr(Index).Tag
Re: saving control properties/names to text
Quote:
Originally Posted by bushmobile
you have to populate the .Tag property when you load the picture. this is what i was doing in my example prj:
VB Code:
picArr(Index).Picture = LoadPicture(cmdlg.FileName)
[B]picArr(Index).Tag = [/B]Mid$(cmdlg.FileName, InStrRev(cmdlg.FileName, "\") + 1) 'could have used cmdlg.FileTitle but forgot
FileCopy cmdlg.FileName, App.Path & "\Temp\" & picArr(Index).Tag
must have missed it :)
for the pbWorkArea (not in control array), it would be like so? Then yours for the other pictureboxes that are in a control array?
VB Code:
Private Sub cmdLoadPicture_Click()
m_strImageFileName = CD.FileName
With frmMain.pbWorkArea
.Picture = LoadPicture(m_strImageFileName)
.BorderStyle = 0
[hl].Tag = Mid$(m_strImageFileName, InStrRev(CD.FileTitle, "\"))[/hl]
CreateTempFilesDirectory
FileCopy m_strImageFileName, App.Path & "\Temp Files\" & .Tag
End With
Unload Me
End Sub
update: invalid procedure call or argument
Re: saving control properties/names to text
should be.
as i mentioned in the post above you can use:
Re: saving control properties/names to text
woohoo! the picture is showing in the project file and its also loading when i load it into the app. pbworkarea done, now for the control array!
Re: saving control properties/names to text
I used the CD.FileTitle as you suggested. the following also worked
VB Code:
Private Sub cmdLoadPicture_Click()
m_strImageFileName = CD.FileName
With frmMain.pbWorkArea
.Picture = LoadPicture(m_strImageFileName)
.BorderStyle = 0
.Tag = Mid$(m_strImageFileName, InStrRev(CD.FileName, "\"))
CreateTempFilesDirectory
FileCopy m_strImageFileName, App.Path & "\Temp Files\" & .Tag
End With
Unload Me
End Sub
but i went with
VB Code:
Private Sub cmdLoadPicture_Click()
m_strImageFileName = CD.FileName
With frmMain.pbWorkArea
.Picture = LoadPicture(m_strImageFileName)
.BorderStyle = 0
.Tag = CD.FileTitle
CreateTempFilesDirectory
FileCopy m_strImageFileName, App.Path & "\Temp Files\" & .Tag
End With
Unload Me
End Sub
Re: saving control properties/names to text
saving the project file now seems to work without any problems. loading also works which is awesome. this part of the app seems to be complete.
thanks so much for your help, i cant say it enough..
Re: [RESOLVED] saving control properties/names to text