如何从代码中启用Menustrip子菜单? [英] How do enable the Menustrip Submenu from follwing code?

查看:121
本文介绍了如何从代码中启用Menustrip子菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码检查用户是否可以访问该特定菜单

如果是,我在消息框中显示使用相同的代码我想在MDI表单上显示该菜单。

这是代码片段

I am Using following code to check whether user has access to that particular menu
if yes I am showing in messagebox by using same code I want to show that menu on MDI form.
This is the code snippet

                while(dr1.HasRows)
                {
                    dr1.Read();
                      foreach (var item in ClassMenu.Menues)
                     {
                         if (dr1["menuname"].ToString().Equals(item.ToString()))
                        {
                            MessageBox.Show(item);
//here itself I want to enable that submenu to user instead of showing it in message box.
                        }
                    }
                }
                 DbConnect.con.Close();
                 dr1.Close();
                 dr1.Dispose();

推荐答案

这篇关于如何从代码中启用Menustrip子菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆