我有一个System.Windows.Forms.Form,并希望在运行时更改Form.Icon以显示状态。我已成功从项目资源中加载了图标:
Type type = this.GetType();
System.Resources.ResourceManager resources =
new System.Resources.ResourceManager(type.Namespace + ".Properties.Resources", this.GetType().Assembly);
this.Icon = (System.Drawing.Icon)resources.GetObject(
type.Namespace + ".Icons." + statusText + ".ico");
但是显示的图标始终保持不变(设计时图标)。我需要调用一个方法告诉表单应用更改吗?我的Form.Icon使用有什么问题吗?