locked
Treeview - Unable to restore previous selection on clicking cancel on a message pop up that is placed on a NodeMouseClick event in vb6 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 12:58 PM

All replies

  • Hello,

    This forum does not support VB6 while the following forum is dedicated to VB6

    http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by Guido Franzke Tuesday, June 18, 2019 5:47 AM
    Monday, June 17, 2019 1:15 PM