If you open any modal dialog inside a keydown event of a TreeView (or in the Form with KeyPreview=true if focus is on a TreeView) you will hear an annoying DING!
How do i prevent it from happening?
This ding usually is a signal that key event wasnt handled (like, by default TextBox will ding for Ctrl+A etc). However, setting e.Handled or e.SuppressKeyPress doesnt help in the case of modal dialog in TreeView. It helps when doing anything EXCEPT opening a modal dialog!
The native Windows treeview control gets very cranky when you pump a message loop in one of its events. The standard solution is to delay the processing of the event until all the events are complete. Easy to do with the Control.BeginInvoke() method. Worked in this case too: