Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Disable button for certain users (ContentMenu)

Disable button for certain users (ContentMenu)

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    isfufushah
    wrote on last edited by
    #1

    How to disable button in the ContentMenu for certain user. I mean, lets say in the login form i have this particular user ADMINISTRATOR, MANAGER, & EXECUTIVE. For the user list button i only want to allow ADMINISTRATOR to view it.?? by the way, thanks a lot for the [View Tab] help. The code works...:-D

    L 1 Reply Last reply
    0
    • I isfufushah

      How to disable button in the ContentMenu for certain user. I mean, lets say in the login form i have this particular user ADMINISTRATOR, MANAGER, & EXECUTIVE. For the user list button i only want to allow ADMINISTRATOR to view it.?? by the way, thanks a lot for the [View Tab] help. The code works...:-D

      L Offline
      L Offline
      Leeland
      wrote on last edited by
      #2

      You need to create roles and demand permissions. Create a Principal permission based on their user and then demand it. Dim myPermission1 as new PrincipalPermission("ADMINISTRATOR", Nothing) Dim mypermission2 as new PrincipalPermission("MANAGER", Nothing) Dim myPermission3 as new Principalpermission("EXECUTIVE", Nothing) Dim myPermission as PrincipalPermission Try myPermission.demand button1.enabled = true Catch 'If they're not in the ManagerGroup it won't run the enabled = true command End Try

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups