toolstripmenu句柄下拉

时间:2017-10-06 17:21:28

标签: c# winforms

我有工具条菜单项,下面有一些其他工具条菜单项。我如何处理第一个工具条菜单(父级),以便在满足某些条件时不打开和显示子项。

所以我有:

Documents: (parent toolstrip item)
----Document1 (child)
----Document2 (child)
----DOcument3 (child)

documentsToolStripMenuItem_Click(object sender, EventArgs e)我有

if(CurrentUser.HasPermission(0001))
{
    MessageBox.Show("You do not have permission to access this module!");
    //Here i need to prevent showing children of this parent
}

总而言之,用户需要获得权限才能按下父工具条菜单项(文档),当他按下它并且没有预设时我不想让他看到那个父母(它的孩子)下面的东西。 / p>

我知道我可以隐藏工具线条或enabled = false但我有其他东西,因为它需要点击它。

1 个答案:

答案 0 :(得分:0)

您必须使用DropDownOpening事件:

success_url
相关问题