Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a treeview in my form. This treeview has a AfterSelect and a DblClick procedure. My problem is, that on a doubleclick the selected (doubleclicked) node expands and collapses. How can I stop my treeview doing that?

 

Thanks.

Posted

Thanks but unfortunately I'm not really sure how to do it. This is how I tried it:

 

Private Sub treDatabase_BeforeExpand(...) Handles treDatabase.BeforeExpand
   If e.Action = TreeViewAction.Expand Then
       If CType(e.Node, DatabaseTreeNode).Database.lngTyp = enmNodeTyp.enmTable Then
           e.Cancel = True
       End If
   End If
End Sub

But then no expand is possible.

 

Any ideas?

  • *Gurus*
Posted
It may not be possible. I assumed there would be a member of the TreeViewAction class specifically for the user having double-clicked a node, but maybe not. If the DblClick event fired just before the BeforeExpand method you might be able to hack something.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...