Vinod Singh

Vinod Singh

  • NA
  • 8
  • 0

Exception is thrown while setting form Icons

Mar 18 2009 10:15 AM

Hi All,

I am getting an Exception(System.Reflection.TargetInvocationException) while setting form icon in InitializeComponent() method on the Line

this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

This Form is a Modal Dialog (i.e. ShowDialog () method is called to show the form )and when user opens this dialog multiple times an exception (System.Reflection.TargetInvocationException) is thrown  on the above mentioned line  

Note:This exception is not thrown if user opens this dialog just one or two times ...the exception is thrown only when user opens the dialog multiple times in succession.

kindly help me in this regard.

thanks alot in advance.....

 


Answers (3)