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.....
Bechir BejaouiPosted Mar 20, 2009, 7:24 AM
http://support.microsoft.com/?scid=kb%3Ben-us%3B828991&x=15&y=11
Vinod SinghPosted Mar 20, 2009, 1:21 AM
Dear Bechir Bejaoui;
I followed the workflow suggested by u but it is still throwing exception...
Plz suggest some other solution..
Regards
VINOD
Bechir BejaouiPosted Mar 18, 2009, 3:53 PM
on loading the page set this.icon to the icon object
in the dispose method of the page set the this.icon to null
try this method