Results 1 to 3 of 3

Thread: Help on menu editor

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    16

    Question Help on menu editor

    Hi all,

    Pleas understand the following situation.

    I have a table named "menu" and having a field "MenuName" char 50 which stores each menu names for a program.

    Also I am using the same names for menu items created by the menu editor. What I have to do is if a menu name which is matching with the field value have to be enabled or disabled accordingly. Also is thery any collection object available for the menus which are created with the menu editor?

    help me as it is very urgent

    regards
    cnbinu

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Re: Help on menu editor

    This should do it for you.

    VB Code:
    1. Option Explicit
    2. Private c As New Collection
    3. Private Sub Form_Load()
    4.  
    5.   Dim m As Menu
    6.  
    7. 'This is where you would read into the collection c from your database.
    8. 'SELECT MenuName FROM menu
    9. 'for each row in recordset
    10. 'c.add MenuName, MenuName
    11. 'next
    12.  
    13.   c.Add "mnuFile", "mnuFile"
    14.   c.Add "mnuFileExit", "mnuFileExit"
    15.   c.Add "mnuEdit", "mnuEdit"
    16.   c.Add "mnuEditFind", "mnuEditFind"
    17.   c.Add "mnuHelp", "mnuHelp"
    18.   c.Add "mnuHelpAbout", "mnuHelpAbout"
    19.  
    20.  
    21.   For Each m In Form1
    22.     EnableMenuItem m
    23.   Next
    24.  
    25.   Set c = Nothing
    26. End Sub
    27.  
    28. Private Sub EnableMenuItem(pMenu As Menu)
    29.   Dim s As String
    30.   On Error GoTo NotEnabled
    31.   s = c.Item(pMenu.Name)
    32.   pMenu.Enabled = True
    33. NotEnabled:
    34. End Sub
    This world is not my home. I'm just passing through.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    16

    Re: Help on menu editor

    Dear TrisuGlow,

    Thank you for the reply.

    regards
    cnbinu

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