I'm using the System.Windows.Forms.PropertyGrid. And I get
the following error when I try to change a drop down
value.
This is the scenario:
I change the value in the dropdown from Url to executable.
This works fine. Then I change the value back to Url and
get the following error message:
An unhandled exception of
type 'System.Runtime.InteropServices.SEHException'
occurred in system.windows.forms.dll
Additional information: External component has thrown an
exception.
When I look into the stack the following message appear:
StackTrace" at
System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW
(MSG& msg)\r\n
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.
UnsafeNativeMethods+IMsoComponentManager.FPushMess ageLoop
(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner
(Int32 reason, ApplicationContext context)\r\n
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32
reason, ApplicationContext context)\r\n
at System.Windows.Forms.Application.Run(Form mainForm)
\r\n
at TestHarness.Form1.Main() in
d:\\source\\shipnet\\core\\preferences\\testharnes s\\form1.
cs:line 117" string
I get no inner exception.
The value Url and Executable is from a enumerator that is
linked to a property FavoriteType in a class. The property
looks like this:
public eFavoriteType FavoriteType
{
get
{
return (eFavoriteType)(this.Value
(s_Property_FavoriteType));
}
set
{
this.Value(s_Property_FavoriteType, (int)
value);
}
}
This error only appears when the windows application is a
class library. When I run the application as a windows
application I do not get this error.
Does anyone have an idea what the problem might be?