Re: menuitem is an object ??

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Agnes (agnes_at_dynamictech.com.hk)
Date: 08/25/04


Date: Wed, 25 Aug 2004 10:16:47 +0800

Thanks for all reply.
Menuitems don't have a name at runtime?! My god. It is a must that I need to
disable some menuitem during run-time. My approach is "My application got
one menu bar , every user got its security tables, he/she got different
permission in each forms. e.g Invoicing , user A allows to use invoice, but
not user B'

As userB Login the application, i need to disable the 'Invoice menu' .
HOWEVER, I can't use the menuitem.text becauese the menu item will be
displayed in GB or B5, or English.
May be I need to change my security design....
>From AGnes

"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> ¦b¶l¥ó
news:evidTHfiEHA.632@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
> Agnes,
> As Imran suggests.
>
> MenuItem is an object, however it is NOT a control.
>
> Your form has both a Menu property that is the main menu, and a
ContextMenu
> (inherited from Control) that is used for context menus.
>
> You need to use the MenuItems collection of the respective menu.
>
> > I need to Me.mnuXXX.Enabled = false during run-time
> > Anyone know how can do that ??
>
> Have you tried?
>
> Me.mnuXXX.Enabled = False
>
> Or are you wanting to dynamically set a menu.Enabled to false based on a
> string? Remember MenuItems don't have names exposed at runtime (they are
> compile time only).
>
> Hope this helps
> Jay
>
>
> "Agnes" <agnes@dynamictech.com.hk> wrote in message
> news:%232G8p2eiEHA.344@TK2MSFTNGP10.phx.gbl...
> > dim c as controls
> > for each c in me.controls
> > messagebox.show(c.name)
> > next c
> >
> > I found that the menu time didn't show up ?? It didn't belongs to the
> > control in the form ???
> > I need to Me.mnuXXX.Enabled = false during run-time
> > Anyone know how can do that ??
> >
> >
>
>



Relevant Pages

  • Re: WebControl Designer Problem using Custom Collection
    ... public C3MenuItemCollection MenuItems ... I'm having some weird things happen in design view while editing a custom ... and drop C3Menu control on it from Toolbox. ... ReadOnly Property As C3MenuItemCollection ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: How to set width of menuitem
    ... I've got an menu control on a webpage which I've managed to work out how ... However I can't seem to be able to set the menuitems widths. ... Dim parentItem As MenuItem ... 'parent home ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: menuitem is an object ??
    ... on my site to give a Tag property to all menuitems, but to be honest, it's ... > As userB Login the application, i need to disable the 'Invoice menu'. ... >> (inherited from Control) that is used for context menus. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: menuitem is an object ??
    ... however it is NOT a control. ... that is used for context menus. ... You need to use the MenuItems collection of the respective menu. ... compile time only). ...
    (microsoft.public.dotnet.languages.vb)
  • CompositeControl design time list problems when altering HTML (Object does not support target type)
    ... I'm really stuck with a Composite Control and I could really do with ... My control has a public property as follows: ... public ListMenuItems ...
    (microsoft.public.dotnet.framework.aspnet)