.NET文化变革的事件? [英] .NET Culture change event?

查看:115
本文介绍了.NET文化变革的事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET自定义控制,在一个文化相关的方式显示信息。为了提高性能,我缓存控制内部的一些信息,而不是生成它每一次。我需要知道,如果文化已经改变了,这样我可以重新生成适当的这种内部信息。

I have a .NET custom control that displays information in a culture dependant way. To improve performance I cache some information inside the control rather than generate it every time. I need to know if the culture has changed so that I can regenerate this internal info as appropriate.

有没有一些事件我有勾成?还是我刚才试的文化设定每次我画的,看它是否改变了?

Is there some event I have hook into? Or do I have to just test the culture setting every time I paint to see if it has changed?

推荐答案

似乎没有事件,但Windows并广播WM_SETTINGSCHANGE消息给所有形式。您可以尝试通过重写的WndProc检测它(请和的这个获得更多信息)。

It seems that there is no event, but Windows does broadcast the WM_SETTINGSCHANGE message to all Forms. You could try detecting it by overriding WndProc (Check this and this for more info).

在这种情况下,你不需要触发一个静态事件,而是作废静态的缓存,然后继续。

In that case you don't need to fire a static event, but rather invalidate your static "cache" and continue.

这篇关于.NET文化变革的事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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