|
-
Feb 20th, 2005, 04:45 AM
#1
Thread Starter
Junior Member
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
-
Feb 21st, 2005, 05:51 AM
#2
Re: Help on menu editor
This should do it for you.
VB Code:
Option Explicit
Private c As New Collection
Private Sub Form_Load()
Dim m As Menu
'This is where you would read into the collection c from your database.
'SELECT MenuName FROM menu
'for each row in recordset
'c.add MenuName, MenuName
'next
c.Add "mnuFile", "mnuFile"
c.Add "mnuFileExit", "mnuFileExit"
c.Add "mnuEdit", "mnuEdit"
c.Add "mnuEditFind", "mnuEditFind"
c.Add "mnuHelp", "mnuHelp"
c.Add "mnuHelpAbout", "mnuHelpAbout"
For Each m In Form1
EnableMenuItem m
Next
Set c = Nothing
End Sub
Private Sub EnableMenuItem(pMenu As Menu)
Dim s As String
On Error GoTo NotEnabled
s = c.Item(pMenu.Name)
pMenu.Enabled = True
NotEnabled:
End Sub
This world is not my home. I'm just passing through.
-
Feb 21st, 2005, 05:58 AM
#3
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|