Why isn't there a SelectedNodeChanged event for Windows.Forms.TreeView?

前端 未结 4 859
深忆病人
深忆病人 2020-12-10 10:04

The System.Web.UI.WebControls.TreeView class offers this event, but the Forms version of TreeView doesn\'t. What\'s the equivalent in the Forms world? I\'m using AfterSelect

4条回答
  •  隐瞒了意图╮
    2020-12-10 10:37

    There's nothing wrong with using AfterSelect.

    However, note that it won't fire if the selection is cleared (if SelectedNode becomes null) Instead, you can handle MouseUp, as recommended in the documentation.

提交回复
热议问题