MDI窗口列表不更新子标题栏文本 [英] MDI window list not updating child title bar texts

查看:227
本文介绍了MDI窗口列表不更新子标题栏文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MDI容器的形式,并更新其标题栏的一些子窗体案文本身,独立。 Text属性的子窗体上的改变后,在打开的菜单时,从孩子新标题栏文字没有更新窗口列表菜单。这是通过物业MdiWindowListItem .NET提供自动生成的窗口列表中。

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.

改变只有当另一个事件物理改变窗口列表(打开一个新的子传播,关闭一个孩子,切换到另一个子)。

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

有没有办法迫使窗口列表的更新编程吗我已经有了一些。代码的地方做菜单启用/在同一时间,孩子的标题栏文字改为禁用

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.

我试过没有成功如下:


  • 更新()在主要的MenuStrip

  • 刷新()在主要的MenuStrip

  • 的Invalidate()在窗口上的MenuStrip

  • 的Invalidate()在窗口列表中的项目之一,在运行时

  • 在一个切换的选中状态两倍在运行时的窗口列表项

  • Update() on the main MenuStrip
  • Refresh() on the main MenuStrip
  • Invalidate() on the window MenuStrip
  • Invalidate() on one of the window list items at runtime
  • Toggling the Checked state twice on one of the window list items at runtime

有似乎没有任何其他可行的远程功能,在菜单项上调用,其父ToolStrip的,或包含菜单系统父窗体。

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.

推荐答案

以上的解决方案并没有为我工作。但是,我跟着链接,发现这一点,这完美的作品:

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);
    }
}

感谢您!

这篇关于MDI窗口列表不更新子标题栏文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆