469,129 Members | 1,735 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,129 developers. It's quick & easy.

Disable Menuitem on Parent form a child

Hi Everyone,
I seem to be having a problem accessing a menuitem on the MDIParent from a
child form. From a login (frmSecurity -child form) screen, I need to hide a
menuitem based on the users role. The problem is that I can't seem to get
access to the menuitem. I can't get it with code like:
MDIParent.mnuAdministrator.Visible = true
MDIParent is the name of the form I gave. This is also the Startup form (in
the project settings) if this makes a difference. From the child form, the
menuitem is not even accessable. I also set the Modifiers property to Public
for the menuitem. And still I can't see it.
So I though I would setup a function in the MDIparent form and call the
function to set it. Here is the call:
MDIParent.SetAdminMenu(iUserRole)
I have no problem with the code in the parent, but the child form can't see
the function either. I set it for Public access. So why can't I even do that?
I'm alittle confused. Did I miss something. Thanks for any help.
Michael Lee
Nov 21 '05 #1
1 2142
Hi,

I dont think naming the form the same as a form's property is a good
idea. This should work from the child form.
DirectCast(Me.MdiParent, MDIParent).mnuAdministrator.Visible = True

Ken

-----------------

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
Hi Everyone,
I seem to be having a problem accessing a menuitem on the MDIParent from a
child form. From a login (frmSecurity -child form) screen, I need to hide a
menuitem based on the users role. The problem is that I can't seem to get
access to the menuitem. I can't get it with code like:
MDIParent.mnuAdministrator.Visible = true
MDIParent is the name of the form I gave. This is also the Startup form (in
the project settings) if this makes a difference. From the child form, the
menuitem is not even accessable. I also set the Modifiers property to Public
for the menuitem. And still I can't see it.
So I though I would setup a function in the MDIparent form and call the
function to set it. Here is the call:
MDIParent.SetAdminMenu(iUserRole)
I have no problem with the code in the parent, but the child form can't see
the function either. I set it for Public access. So why can't I even do
that?
I'm alittle confused. Did I miss something. Thanks for any help.
Michael Lee

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marcel | last post: by
6 posts views Thread by Claus Holm | last post: by
5 posts views Thread by Brian Henry | last post: by
3 posts views Thread by Eddie | last post: by
4 posts views Thread by Richard Lewis Haggard | last post: by
3 posts views Thread by Richard Lewis Haggard | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.