I have a treeview with 1000 items. When I select an item, the treeview fires an event so I can update something in my GUI. The event handler is non recursive and has no loops, but it does take a little bit of time to complete, maybe 100ms.
If I select the top item and use the down arrow to scroll through items slowly, everything works fine, but if I hold down the arrow key, the event fires too quickly and I get a stackoverflow exception.
I thought about putting a timer in the treeview so the selectionchanged event can only fire every 100ms or so, but that seems very hackish. Any ideas for fixing this?