Hmmm, are you placing that code in the treeview's KeyDown event?
If so, add the exact code I posted (changing Treeview1 to your treeview's name) and append this line at the end:
:: KeyCode = 0