Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Menu Access

Status
Not open for further replies.

PM2000

Programmer
Aug 18, 2000
42
BM
Hi,

In VB6, I had an MDI app that was used office wide and each person was allowed different levels of access.

For example, on a menu named Process, there were 3 functions. Person A could access Function 1 and 2 while Person B could Access 1 and 3.

When Person A logged in, my app checked the access rights of Person A and disabled the menu item for which he was not allowed access. This was done by using code something like the following on loading the form.

Dim ctl as control

For each ctl in me.form
If ctl.Tag = "A" then
ctl.enabled = true
Else
ctl.enabled = false
End If

next ctl


The menu items in the app had a tag that was specific to a level of control, so the control was enabled/disabled if the right tag was present.

In vb.net, I am trying to figure out the best way to control access like I did in VB6. The menu items don't have a tag property and they are not included in the control collection for the form.

Has anyone come across this issue?

Regards,
Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top