Bettter yet if this was in the setter method of a public property, with an event handler in it?
.NET 2.0 set the binding source property (listBox, Combox etc..), this fires SelectedItemChanged.
Put any code in the event handler that throws an unhandled exception, and the component f’ing swallows it.
try
{
bs = value;
}
catch
{
displayvalue = “”;
}
I know how to get round it, there’s even a comment in there about why teh code looks strange.
What I can’t figure out is why some one at Redmond thought this was the way to go.
What am I missing.?