"The code is exactly
how I would like to write code and the algorithms used are very
efficient and well-documented."
Van T. Dinh, Microsoft MVP
|
|
Class: CMRU
Class that handles processing of "Most Recently Used" menu items on a form. This class is commonly used to store the "Most Recently Used" file list for menu items on a form, but the list of items does not have to be a list of files. It could be used for any unique items you wish to store and display on a form's menu.
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CMRU class
|
|
MaxMRUItems
|
Property
|
Sets the number of visible menu items, not counting the separator. This property defaults to 4.
|
|
MenuItem
|
Property
|
Gets the specified menu item.
All entries from 0 to the value of MaxMenuItems must be assigned a particular menu on your form. The value 0 is used for the "separator" menu item.
|
|
Prefix
|
Property
|
Gets the Prefix string currently used for the MRU entries in the registry (defaults to MRU)
|
|
RegistryPath
|
Property
|
Gets the current registry path string used fro the MRU entries (defaults to SOFTWARE\ plus the value of App.Title)
|
|
RootKey
|
Property
|
Sets the RootKey of the registry location to use for the MRU entries in the registry (defaults to mrrkHKeyLocalMachine, or the "HKEY_LOCAL_MACHINE" hive of the registry)
|
|
SubKey
|
Property
|
Gets the current SubKey of the registry location used for the MRU entries in the registry.
If not specified, or set to "", the MRU settings are stored in the root of the key indicated by the RegistryPath property.
|
|
TagPrefix
|
Property
|
Sets the TagPrefix string to use for the MRU tag entries in the registry (defaults to "MRUTAG")
|
|
Class_Initialize
|
Initialize
|
Set initial values to defaults which may be overridden with property settings
|
|
Class_Terminate
|
Terminate
|
Clean up local static storage
|
|
GetMRUList
|
Method
|
Retrieves the current MRU entries from the Windows registry, and updates the captions for the form's MRU Menu Items.
Call this method whenever you wish to update your form's menus with the latest values stored in the MRU portion of the registry maintained by the SetMRUList method. Note that it is not necessary to call this method after using SetMRUList, since the SetMRUList method automatically retrieves the latest information.
|
|
RegistryGetKeyValue
|
Private
|
Returns a value from the system registry
|
|
RegistrySetKeyValue
|
Private
|
Sets a key value in the registry, creating it if it doesn't already exist
|
|
SetMRUList
|
Method
|
Add the specified item to the top of the MRU list, or clear the MRU list.
Add the specified item to the top of the MRU list, if it is already present. Otherwise replace the current first item with the new item, and remove the remaining items down the list.
|
Overview of Total Visual SourceBook
The source code in Total Visual
SourceBook includes modules and classes for Microsoft Access, Visual
Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily
add this professionally written, tested, and documented royalty-free code
into your applications to simplify your application development efforts.
Additional Resources
|
|