winform程序问题,为什么启动子窗口的时候,主程序主图标下面是默认图标,而不是我自定义的图标。程序地址:http://download.csdn.net/detail/jiayp004/4301072
谢谢。

解决方案 »

  1.   

    http://blog.csdn.net/juanna_ding/article/details/5510658
      

  2.   

        this.Icon = new System.Drawing.Icon(@"C:\Documents and Settings\aaa\桌面\Google.ico");窗体加载时加上上面代码
      

  3.   

    不要用窗体的属性Icon给窗体加图标,这样不容易维护,如果图标要改就得一个个窗口去改,这样用代码控制改图标时直接改图片,所有窗体就都改过来了
      

  4.   

    各位的方法我都试过了,大家肯定没有运行我的程序,因为上述方法没有效果,注意关闭窗口的时候用的是 Hide,而没有释放。
      

  5.   

    改m_f2.Show();这里: 
         m_f2.Activated += new EventHandler(m_f2_Activated);
         m_f2.Show();
         //m_f2.Icon = this.Icon;
    }        void m_f2_Activated(object sender, EventArgs e)
            {
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form2));
                ((Form2)sender).Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 
            }
      

  6.   

    6楼正解。
    我下了你的程序,在窗体第一次被激活时,设置一下他的图标就成。
    这是vs2005mdi子窗体第一次最大化加载的一个遗憾