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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Meny enable/disable

Status
Not open for further replies.

extempore

Programmer
Jun 1, 2001
71
US
I want to enable and disable menu items dynamically based on the value set in the table. Meaning, I have 2 column table (first column with string menu item name (m_menu.m_item) and second column with string ('Y'/'N'))

I want to get this to work on the Open event of the window:

For e.g
Get the values from the table

IF 'Y' THEN m_menu.m_item.Enabled = TRUE

Can someone help me with this..sample code to enable/disble menu item based in the table would be nice. Thanks in advance.
 
I've done this for a MDI application (via a menu service and the pfc).

For a single window you need to retrieve the settings from the db (into a datastore), loop through the rows, set the enabled properties like in your example.
 
If the details of the menu like the menu id is stored in a database, what command should I use to access the value from the database and enable/disable the menu items. This i require it for the security that I am making for the applicaiton. Plus how do I get the list of items in variables, like my first main menu item is File which has Open, Close, etc... then if I want to take the items in variables in source code, how should I do that.
 
I have done this... You have to design two tables one MenuMaster in which all the details regarding menus will be there with their respective name and their options with their window name. Second will be MenuRights in that userwise rights will be there for add, modify, delete, view, report view etc.
 
I would be interested to see an example of code for this. This would be very useful for me as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top