Heike Posted August 19, 2002 Posted August 19, 2002 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. Quote
*Gurus* divil Posted August 19, 2002 *Gurus* Posted August 19, 2002 With the BeforeExpand event. You can check e.Action, and determine what event (keyboard, mouse etc) caused the node to expand. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Heike Posted August 19, 2002 Author Posted August 19, 2002 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? Quote
*Gurus* divil Posted August 19, 2002 *Gurus* Posted August 19, 2002 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
keitsi Posted August 9, 2004 Posted August 9, 2004 TreeView doubleclick-expand hack Here. http://www.xtremedotnettalk.com/showthread.php?p=424382#post424382 Quote BS - Beer Specialist
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.