473,396 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Merged menus (enable/disable them)

I have a form with a main menu on it (mdi parent form) and i have a child
form with a menu and I am mergeing the menus together for the menu called
reports.. now when i do this they merge just fine.. but i need to disable
the menu when the user logs out of the system or clear it so they cant run
reports still after logout. but when i try to set the mdi parent's menu's
mnuReports item's enabled property to false it throws an item isnt set to an
instance of an object exception back. why would it cause this? and how would
i go about placeing a security constraint like this on a merged menu? thanks
Nov 20 '05 #1
5 1515
Hi. Brian

it could be because after merge you have 2 different menu items - one in mdi
menu and another in mnuReports. If you use menu item from mnuReports - it's
not present in mdi menu.

HTH
Alex

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have a form with a main menu on it (mdi parent form) and i have a child
form with a menu and I am mergeing the menus together for the menu called
reports.. now when i do this they merge just fine.. but i need to disable
the menu when the user logs out of the system or clear it so they cant run
reports still after logout. but when i try to set the mdi parent's menu's
mnuReports item's enabled property to false it throws an item isnt set to an instance of an object exception back. why would it cause this? and how would i go about placeing a security constraint like this on a merged menu? thanks

Nov 20 '05 #2
any ideas on how to do something like this though? any code can be changed
that needs to be.
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi. Brian

it could be because after merge you have 2 different menu items - one in mdi menu and another in mnuReports. If you use menu item from mnuReports - it's not present in mdi menu.

HTH
Alex

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have a form with a main menu on it (mdi parent form) and i have a child form with a menu and I am mergeing the menus together for the menu called reports.. now when i do this they merge just fine.. but i need to disable the menu when the user logs out of the system or clear it so they cant run reports still after logout. but when i try to set the mdi parent's menu's mnuReports item's enabled property to false it throws an item isnt set
to an
instance of an object exception back. why would it cause this? and how

would
i go about placeing a security constraint like this on a merged menu?

thanks


Nov 20 '05 #3
Hi, Brian

you might need to loop through mdi menu and find out which menu items to
disable.
Another way - disable your mnuReport items and recreate mdi menu anew.

HTH
Alex

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:eI**************@TK2MSFTNGP11.phx.gbl...
any ideas on how to do something like this though? any code can be changed
that needs to be.
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi. Brian

it could be because after merge you have 2 different menu items - one in

mdi
menu and another in mnuReports. If you use menu item from mnuReports -

it's
not present in mdi menu.

HTH
Alex

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have a form with a main menu on it (mdi parent form) and i have a child form with a menu and I am mergeing the menus together for the menu called reports.. now when i do this they merge just fine.. but i need to disable the menu when the user logs out of the system or clear it so they cant run reports still after logout. but when i try to set the mdi parent's menu's mnuReports item's enabled property to false it throws an item isnt set

to
an
instance of an object exception back. why would it cause this? and how

would
i go about placeing a security constraint like this on a merged menu?

thanks



Nov 20 '05 #4
Hi Brian,

As Alex said, we can loop through the menuitems to disable certain item.
e.g.

Dim mm As MainMenu = Me.Menu
For Each o As MenuItem In mm.MenuItems
'disable the first menuitem in Child form
o.MenuItems(0).Enabled = False
Debug.WriteLine(o.Text)
Next
mm = Me.MdiParent.Menu
For Each o As MenuItem In mm.MenuItems
'disable the first menutiem in MDIParent form
o.MenuItems(0).Enabled = False
Debug.WriteLine(o.Text)
Next

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #5
thanks

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:l%****************@cpmsftngxa10.phx.gbl...
Hi Brian,

As Alex said, we can loop through the menuitems to disable certain item.
e.g.

Dim mm As MainMenu = Me.Menu
For Each o As MenuItem In mm.MenuItems
'disable the first menuitem in Child form
o.MenuItems(0).Enabled = False
Debug.WriteLine(o.Text)
Next
mm = Me.MdiParent.Menu
For Each o As MenuItem In mm.MenuItems
'disable the first menutiem in MDIParent form
o.MenuItems(0).Enabled = False
Debug.WriteLine(o.Text)
Next

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76)...
0
by: cefrancke | last post by:
I recently discovered, that if you set the startup options for "security", you will have alot of work do to get Access back to "normal". If you disable the built-in menus/toolbars you'll have to...
2
by: ouech | last post by:
hi, i'm still having troubles with my menus the EnableMenuItem function doesn't seem to work at all in a MDI. i'm doing exactly the same thing as i did when i coded a dialog based App with a...
8
by: rongchaua | last post by:
Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic about this problem. Has someone done with this...
10
by: Gary Jefferson | last post by:
Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B', and each module has its own logger, created with: module1logger = logging.getLogger('project.A') and module2logger =...
1
by: coolarian | last post by:
Hi, I have an C# MDI application. There are three mdi childs, mdiFormA, childB and childC. childA is loaded in the parent by default as below: private void TestingMenu_Load(object sender,...
1
by: skyousafzai | last post by:
hi frndz i m new thiz.........n doin project for BCS Degree....i need help regarding users view...i mean tat when user log-in he shud got his view n da menus which he got ta right to wud b enable...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
56
by: Deepan HTML | last post by:
Hi All, Currently i am working in a framed environment where i have divided the window as 20% and 80% and the 20% is used for navigation purpose and right frame for displaying the orignal content....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.