久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Winforms 中禁用的菜單項仍顯示子項

Disabled menu items in Winforms still show subitems(Winforms 中禁用的菜單項仍顯示子項)
本文介紹了Winforms 中禁用的菜單項仍顯示子項的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

如果我創建一個包含兩個項目的菜單(比如Item1"和Item2",然后在每個項目下創建兩個子項目(1A、1B、2A 和 2B),然后禁用 Item1,我希望 1A 和1B 不會顯示.

If I create a menu with two items (say "Item1" and "Item2" and then create two subitems under each one (1A, 1B, 2A and 2B), and then disable Item1, I'd expect that 1A and 1B wouldn't show.

而且,事實上,如果我轉到 Item1,他們就不會.除非我接著移至 Item2,等待 2A 和 2B 顯示,然后移回 Item1.此時 1A 和 1B 都彈出,完全激活.

And, indeed, if I move onto Item1 they don't. Unless I then move on to Item2, wait for 2A and 2B to show, and then move back to Item1. At which point 1A and 1B both pop up, fully active.

這是一個已知的錯誤嗎?這是我可以解決的問題嗎?有什么建議嗎?

Is this a known bug? Is it something I can work around? Any suggestions?

用戶希望能夠看到當前被禁用的東西,或者我只是讓東西不可見.遺憾的是,這不是我們可以輕松使用的選項.

The users want to be able to see the things that are currently disabled, or I'd just make things invisible. Sadly, this isn't an option we can easily use.

推薦答案

我可以確認在 MenuStrip for Framework 2.0、3.5 和 4.0 中會發生這種情況.我唯一合理的解決方法是將 Visible 屬性設置為 false,因此該項目根本不會出現.不理想,但比讓子項目可訪問要好.

I can confirm that this occurs with the MenuStrip for Framework 2.0, 3.5 and 4.0. The only reasonable workaround that I have is to set the Visible property to false, so the item does not appear at all. Not Ideal, but better than having the sub-items accessible.

當然你也可以創建一個函數來遞歸禁用所有子項,這樣即使出現了,也至少是禁用的,你需要保持之前的狀態,以確保以后不會重新啟用一個實際上打算被禁用的子項目等.文檔表明這實際上是發生了什么,但事實并非如此,即使父項目被禁用,子項目仍然保持啟用狀態.

Of course you can also create a function that will recursively disable all child items, that way even if they appear, they are at least disabled, you will need to maintain the previous state to ensure that you do not later re-enable a child item that is actually inteded to be disabled etc. The documentation indicates that this is actually what happens, but that is not the case, sub-items remain enabled even when the parent item is disabled.

這篇關于Winforms 中禁用的菜單項仍顯示子項的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發問題)
Yield return from a try/catch block(try/catch 塊的收益回報)
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務的 SqlCommand 時,我應該調用 Parameters.Clear 嗎?)
what does a using statement without variable do when disposing?(處理時不帶變量的 using 語句有什么作用?)
Why doesn#39;t TransactionScope work with Entity Framework?(為什么 TransactionScope 不適用于實體框架?)
How to dispose TransactionScope in cancelable async/await?(如何在可取消的 async/await 中處理 TransactionScope?)
主站蜘蛛池模板: 最新国产精品视频 | 国产成人小视频 | 亚洲精品久久久久久一区二区 | 国产日屁| 美女福利视频网站 | 精品视频导航 | 亚洲午夜电影 | 国产成人精品一区二区三区 | 罗宾被扒开腿做同人网站 | 久久久www | 四色成人av永久网址 | 狠狠躁18三区二区一区 | 亚洲成人一二区 | 日韩精品免费 | 91av入口| 一区二区三区日韩 | 精品美女视频在免费观看 | 99免费视频 | 精品国产欧美一区二区三区成人 | 久久午夜精品福利一区二区 | 欧美精品一区久久 | 天天天操天天天干 | 皇色视频在线 | 精品欧美乱码久久久久久1区2区 | 久久久久久国产精品免费免费狐狸 | 日韩在线小视频 | 国产亚洲精品一区二区三区 | 久久99精品久久久久子伦 | 亚洲成人999 | 亚洲国产精品久久久 | 精品一区二区三区在线观看 | 中国一级特黄真人毛片 | 99久久婷婷国产精品综合 | 99久久久久久99国产精品免 | 欧美一级免费看 | 亚洲精品国产电影 | 国产做爰 | 国产三区av| 成人福利网 | 色婷婷国产精品综合在线观看 | 欧美一级在线观看 |