我有一些tooltrip菜單項,下面有一些其他的tooltrip菜單項。我如何處理第一個工具欄菜單(父),以便在某些條件滿足時不打開並顯示孩子。toolstripmenu拉手下拉
所以我有:
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
}
所以總結起來,用戶需要允許按父工具條菜單項(文檔),當他按下它,沒有權利,我不想讓他看到那個父母下面是什麼(這是孩子)。
我知道我可以使該工具欄菜單隱藏或enabled = false
但我有其他的東西,因爲它需要點擊。
建立依賴於用戶的權限菜單,則不需要進一步的檢查。 – dcg
我寫道,我需要看到有按鈕,我需要被允許點擊,即使我沒有權限 – DoLoop