none
Is there a way to implement an event like “BeforeSelect” in the treeview? RRS feed

  • Question

  • Consider a TreeView control containing multiple nodes. On selecting a node, certain information is displayed on a text box. This information can be modified and saved. Accidentally, if a user navigates to a different node without saving, a pop is displayed asking the user to save or cancel the action. If cancel is clicked, selection should remain on the previously selected node instead of a new node.

    The logic to display pop up is written in BeforeSelect() event of TreeView. Below code works fine in c#.

    But it is not working in case of VB6 because we don't have a BeforeSelect Event in VB6. Is there any way to achieve this in VB6?

    private void TreeView1_BeforeSelect(object sender,TreeViewCancelEventArgs e)
    {
        If(Check for anychange)
        {
            e.Cancel=true;
        }
    }
    Monday, June 17, 2019 3:33 PM

All replies