E
Eric
I am attempting to change at runtime the Icon for an ErrorProvider.
When I do so and call SetError(thisControl, "msg") I receive an
IndexOutOfRangeException.
Code snippet:
....
Assembly _assembly = Assembly.GetExecutingAssembly();
Stream _icon =
_assembly.GetManifestResourceStream("MyNameSpace.checkmark.ico");
thisErrorProvider.Icon = new Icon(_icon);
thisErrorProvider.SetError(thisControl, "Checked");
....
To cover the obvious, yes, the Build Action Property of checkmark.ico
is Embedded Resource.
Here is the exception stacktrace:
System.IndexOutOfRangeException was unhandled
Message="Index was outside the bounds of the array."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.ErrorProvider.IconRegion.get_Region()
at
System.Windows.Forms.ErrorProvider.ErrorWindow.Update(Boolean
timerCaused)
at
System.Windows.Forms.ErrorProvider.ErrorWindow.Add(ControlItem item)
at System.Windows.Forms.ErrorProvider.ControlItem.AddToWindow()
at
System.Windows.Forms.ErrorProvider.ControlItem.set_Error(String value)
at System.Windows.Forms.ErrorProvider.SetError(Control control,
String value)
....
I'm digging through msdn now. Any advice is appreciated.
Many Thanks,
Eric
When I do so and call SetError(thisControl, "msg") I receive an
IndexOutOfRangeException.
Code snippet:
....
Assembly _assembly = Assembly.GetExecutingAssembly();
Stream _icon =
_assembly.GetManifestResourceStream("MyNameSpace.checkmark.ico");
thisErrorProvider.Icon = new Icon(_icon);
thisErrorProvider.SetError(thisControl, "Checked");
....
To cover the obvious, yes, the Build Action Property of checkmark.ico
is Embedded Resource.
Here is the exception stacktrace:
System.IndexOutOfRangeException was unhandled
Message="Index was outside the bounds of the array."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.ErrorProvider.IconRegion.get_Region()
at
System.Windows.Forms.ErrorProvider.ErrorWindow.Update(Boolean
timerCaused)
at
System.Windows.Forms.ErrorProvider.ErrorWindow.Add(ControlItem item)
at System.Windows.Forms.ErrorProvider.ControlItem.AddToWindow()
at
System.Windows.Forms.ErrorProvider.ControlItem.set_Error(String value)
at System.Windows.Forms.ErrorProvider.SetError(Control control,
String value)
....
I'm digging through msdn now. Any advice is appreciated.
Many Thanks,
Eric