久久久久久久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?)
主站蜘蛛池模板: 国产日韩一区二区三免费高清 | 国产精品免费视频一区 | 久久久成人精品 | 精品亚洲一区二区三区 | 婷婷综合在线 | 亚洲精品国产一区 | 欧美一级视频在线观看 | 337p日韩| 欧美成人精品在线观看 | 国产亚洲精品美女久久久久久久久久 | 国产精品乱码一区二区三区 | 日本精品一区二区三区视频 | 久久久国产一区 | 国产精品看片 | 国产精品久久久久久久久久久久冷 | 亚洲精品亚洲人成人网 | 亚洲精品视频播放 | 水蜜桃亚洲一二三四在线 | 国产精品欧美精品 | 欧美激情国产精品 | 免费精品久久久久久中文字幕 | 精品亚洲一区二区 | 日韩欧美视频免费在线观看 | 免费一级片 | 一级网站 | 国产在线视频一区二区董小宛性色 | 久久久久久久久久久久一区二区 | 国产91网址| 2021天天干夜夜爽 | 国产欧美一区二区三区免费 | 天天干.com | 国产激情综合五月久久 | 91毛片网 | 日韩一区二区三区av | 欧美成人激情 | 成人国产精品免费观看视频 | 涩爱av一区二区三区 | 久久av一区二区三区 | 国产成人福利视频在线观看 | 亚洲欧美成人在线 | 国产成人精品a视频一区www |