Results 1 to 7 of 7

Thread: menu list to list the file name which have opened.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    menu list to list the file name which have opened.

    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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: menu list to list the file name which have opened.

    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.
    Attached Files Attached Files

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Re: menu list to list the file name which have opened.

    i only want to let the user select the picture in format ".bmp".
    so,how to do it.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: menu list to list the file name which have opened.

    Quote Originally Posted by junlo
    i only want to let the user select the picture in format ".bmp".
    so,how to do it.
    What picture?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Re: menu list to list the file name which have opened.

    Quote Originally Posted by Hack
    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.
    Code:
    Private Sub mnuFileMRU_Click(Index As Integer)
       
        ShellExecute Me.hwnd, vbNullString, mnuFileMRU(Index).Caption, _
        vbNullString, "C:\", SW_SHOWNORMAL
     
    End Sub
    what does the code above means? can somebody explain on it?

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: menu list to list the file name which have opened.

    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.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Re: menu list to list the file name which have opened.

    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
    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.

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width