How to write the code to let the menu show a list of file name which had been opened.(history which file had openned)
in addition, if click the name in that list.the file will open again.
Printable View
How to write the code to let the menu show a list of file name which had been opened.(history which file had openned)
in addition, if click the name in that list.the file will open again.
You are talking about an MRU (Most Recently Used) List. Here is an example that I put together some time ago.
It is very basic, so feel free to soup it up. :)
i only want to let the user select the picture in format ".bmp".
so,how to do it.
:confused: What picture?Quote:
Originally Posted by junlo
Quote:
Originally Posted by Hack
what does the code above means? can somebody explain on it?Code:Private Sub mnuFileMRU_Click(Index As Integer)
ShellExecute Me.hwnd, vbNullString, mnuFileMRU(Index).Caption, _
vbNullString, "C:\", SW_SHOWNORMAL
End Sub
It takes the menu caption, and executes it. That is how, with an MRU, you are able to redo something that you have recently done that was saved to your MRU List.
i used the code above and came out an error "path not found" (point to line in red color)when i click the MRU because that file not in that directory.Code:Private Sub mnuFileMRU_Click(index As Integer)
strFileNewName1 = (Left(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "\DAF")) & "Map\")
strFileNewName2 = (Mid(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "MY"), 8) & ".bmp")
strFileNewName3 = strFileNewName1 & strFileNewName2
Picture1.Picture = LoadPicture(strFileNewName3)
Call ConvertMRU
Call ENCExtractMRU
Call setScale
blnOkToMove = True
End Sub
how to add code to above to avoid the error occur and also came out a message to let user know that the file is not find.