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

MDI 窗口列表不更新子標(biāo)題欄文本

MDI window list not updating child title bar texts(MDI 窗口列表不更新子標(biāo)題欄文本)
本文介紹了MDI 窗口列表不更新子標(biāo)題欄文本的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我有一個(gè) MDI 容器表單,以及一些獨(dú)立更新其標(biāo)題欄文本的子表單.在子窗體上更改 Text 屬性后,當(dāng)打開(kāi)菜單時(shí),子窗體中的新標(biāo)題欄文本不會(huì)在窗口列表菜單中更新.這是 .NET 通過(guò) MdiWindowListItem 屬性提供的自動(dòng)生成的窗口列表.

I have a MDI container form, and some child forms that update their title bar texts themselves, independently. After the Text property is changed on the child form, the new title bar text from the child is not updated in the window list menu when the menu is opened. This is the auto-generated window list provided by .NET via the MdiWindowListItem property.

僅當(dāng)另一個(gè)事件物理更改窗口列表(打開(kāi)一個(gè)新子項(xiàng)、關(guān)閉一個(gè)子項(xiàng)、切換到另一個(gè)子項(xiàng))時(shí),更改才會(huì)傳播.

The change only propagates when another event changes the window list physically (opening a new child, closing a child, switching to another child).

有沒(méi)有辦法以編程方式強(qiáng)制更新窗口列表?我已經(jīng)有一些代碼可以在更改子標(biāo)題欄文本的同時(shí)啟用/禁用菜單.

Is there a way to force an update of the window list programmatically? I already have some code in place to do menu enabling/disabling at the same time the child's title bar text is changed.

我嘗試了以下方法但沒(méi)有成功:

I tried the following with no success:

  • 主 MenuStrip 上的 Update()
  • Refresh() 在主 MenuStrip 上
  • Invalidate() 在窗口 MenuStrip 上
  • 在運(yùn)行時(shí)對(duì)窗口列表項(xiàng)之一進(jìn)行 Invalidate()
  • 在運(yùn)行時(shí)在窗口列表項(xiàng)之一上切換 Checked 狀態(tài)兩次

似乎沒(méi)有任何其他遠(yuǎn)程可行的函數(shù)可以在菜單項(xiàng)、其父 ToolStrip 或包含菜單系統(tǒng)的父窗體上調(diào)用.

There don't seem to be any other remotely viable functions to call on the menu item, its parent ToolStrip, or the parent form that contains the menu system.

推薦答案

上述解決方案對(duì)我不起作用.但我按照鏈接,發(fā)現(xiàn)了這個(gè),效果很好:

The above solution did not work for me. But I followed the link, and found this, which works perfectly:

private void windowMenu_DropDownOpening(object sender, EventArgs e)
{
    if (this.ActiveMdiChild != null)
    {
        Form activeChild = this.ActiveMdiChild;

        ActivateMdiChild(null);
        ActivateMdiChild(activeChild);
    }
}

謝謝!

這篇關(guān)于MDI 窗口列表不更新子標(biāo)題欄文本的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發(fā)問(wèn)題)
Yield return from a try/catch block(try/catch 塊的收益回報(bào))
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務(wù)的 SqlCommand 時(shí),我應(yīng)該調(diào)用 Parameters.Clear 嗎?)
what does a using statement without variable do when disposing?(處理時(shí)不帶變量的 using 語(yǔ)句有什么作用?)
Why doesn#39;t TransactionScope work with Entity Framework?(為什么 TransactionScope 不適用于實(shí)體框架?)
How to dispose TransactionScope in cancelable async/await?(如何在可取消的 async/await 中處理 TransactionScope?)
主站蜘蛛池模板: 日韩欧美亚洲 | 国产高清区| www.亚洲一区二区三区 | 一区二区久久电影 | 美女精品一区 | 玖玖精品| 日韩在线观看一区 | 国产精品久久久久久久久久妇女 | 91av导航 | 中文字幕亚洲视频 | 精品视频一区二区 | 亚洲免费在线观看 | 黄色毛片一级 | 亚洲 欧美 另类 综合 偷拍 | 中国美女撒尿txxxxx视频 | 水蜜桃久久夜色精品一区 | 国产一区二区免费电影 | 精品一区二区三区在线观看国产 | 在线视频一区二区 | 久久久久久免费毛片精品 | 高清一区二区三区 | 国产二区精品视频 | 日韩www| 日本在线视频一区二区 | 免费毛片网| 久久aⅴ乱码一区二区三区 亚洲国产成人精品久久久国产成人一区 | 成人黄色电影免费 | 91久久精品一区二区二区 | 亚洲精品一区在线观看 | 精品国产视频在线观看 | 一级黄色绿像片 | 精品区一区二区 | 国产欧美日韩在线 | 成人精品| 日韩欧美精品在线 | 亚洲精品在线免费观看视频 | 91在线观看视频 | 国产精品完整版 | 91在线免费观看网站 | 操人网站 | 欧美视频xxx |