Results 1 to 1 of 1

Thread: MRU library

  1. #1

    Thread Starter
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    MRU library

    Add an MRU (most recently used) menu to your applications.

    usage

    Create a Windows Application

    Add a reference to the MRUClass.dll

    include the namespace
    using Menu.Util.MRU;

    declare your mru menuitem
    private Menu.Util.MRU.MRUMenuItem mru;


    in the initialisation section
    ...
    mru = new MRUMenuItem("Recent",3);
    mru.MRUEvent+= new MRUEventHandler(MRU_Clicked);
    //assuming there is alread a file menu
    mniFile.MenuItems.Add(mru);
    mru.LoadMRUFile(Application.StartupPath + "\\mru.dat");
    ...

    when an mru menuitem is clicked this method will be called
    void MRU_Clicked(object sender,MRUEventArgs e)
    {
    MessageBox.Show(e.FilePath);
    }

    every time a file is opened call this method
    ...
    mru.AddItem(fileOpenDialog1.FileName);
    ...

    before closing the application save the current status
    ...
    mru.SaveMRUFile(Application.StartupPath + "\\mru.dat");
    ...
    Attached Files Attached Files

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