Treeview - Unable to restore previous selection on clicking cancel on a message pop up that is placed on a NodeMouseClick event in vb6

  • Thread starter Thread starter pink_diamond
  • Start date Start date
P

pink_diamond

Guest
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;

}

}

Continue reading...
 
Back
Top